3v4l.org

run code in 500+ PHP versions simultaneously
<?php $iterator = new \AppendIterator(); $inner1 = new AppendIterator(); $inner1->append(new ArrayIterator([1, 2, 3])); $iterator->append($inner1); $iterator->append(new ArrayIterator([11, 12, 13])); echo "-> iteration", "\n"; while($iterator->valid()) { echo $iterator->current(), "\n"; $iterator->next(); } echo "-> foreach", "\n"; foreach($iterator as $val) { echo $val, "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 24
Branch analysis from position: 33
2 jumps found. (Code = 77) Position 1 = 36, Position 2 = 40
Branch analysis from position: 36
2 jumps found. (Code = 78) Position 1 = 37, Position 2 = 40
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 24
Branch analysis from position: 33
Branch analysis from position: 24
filename:       /in/EN75q
function name:  (null)
number of ops:  42
compiled vars:  !0 = $iterator, !1 = $inner1, !2 = $val
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   NEW                                                  $3      'AppendIterator'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $3
    5     3        NEW                                                  $6      'AppendIterator'
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !1, $6
    6     6        INIT_METHOD_CALL                                             !1, 'append'
          7        NEW                                                  $9      'ArrayIterator'
          8        SEND_VAL_EX                                                  <array>
          9        DO_FCALL                                          0          
         10        SEND_VAR_NO_REF_EX                                           $9
         11        DO_FCALL                                          0          
    7    12        INIT_METHOD_CALL                                             !0, 'append'
         13        SEND_VAR_EX                                                  !1
         14        DO_FCALL                                          0          
    9    15        INIT_METHOD_CALL                                             !0, 'append'
         16        NEW                                                  $13     'ArrayIterator'
         17        SEND_VAL_EX                                                  <array>
         18        DO_FCALL                                          0          
         19        SEND_VAR_NO_REF_EX                                           $13
         20        DO_FCALL                                          0          
   11    21        ECHO                                                         '-%3E+iteration'
         22        ECHO                                                         '%0A'
   12    23      > JMP                                                          ->30
   13    24    >   INIT_METHOD_CALL                                             !0, 'current'
         25        DO_FCALL                                          0  $16     
         26        ECHO                                                         $16
         27        ECHO                                                         '%0A'
   14    28        INIT_METHOD_CALL                                             !0, 'next'
         29        DO_FCALL                                          0          
   12    30    >   INIT_METHOD_CALL                                             !0, 'valid'
         31        DO_FCALL                                          0  $18     
         32      > JMPNZ                                                        $18, ->24
   17    33    >   ECHO                                                         '-%3E+foreach'
         34        ECHO                                                         '%0A'
   18    35      > FE_RESET_R                                           $19     !0, ->40
         36    > > FE_FETCH_R                                                   $19, !2, ->40
   19    37    >   ECHO                                                         !2
         38        ECHO                                                         '%0A'
   18    39      > JMP                                                          ->36
         40    >   FE_FREE                                                      $19
   20    41      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.96 ms | 2555 KiB | 13 Q