3v4l.org

run code in 300+ PHP versions simultaneously
<?php $it = new \AppendIterator(); $it->append(new ArrayIterator(['foo'])); foreach ($it as $item) { echo $item; if ('foo' === $item) { $it->append(new ArrayIterator(['bar'])); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 21
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 21
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 20
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/itLi1
function name:  (null)
number of ops:  23
compiled vars:  !0 = $it, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'AppendIterator'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    4     3        INIT_METHOD_CALL                                         !0, 'append'
          4        NEW                                              $5      'ArrayIterator'
          5        SEND_VAL_EX                                              <array>
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $5
          8        DO_FCALL                                      0          
    6     9      > FE_RESET_R                                       $8      !0, ->21
         10    > > FE_FETCH_R                                               $8, !1, ->21
    7    11    >   ECHO                                                     !1
    9    12        IS_IDENTICAL                                             !1, 'foo'
         13      > JMPZ                                                     ~9, ->20
   10    14    >   INIT_METHOD_CALL                                         !0, 'append'
         15        NEW                                              $10     'ArrayIterator'
         16        SEND_VAL_EX                                              <array>
         17        DO_FCALL                                      0          
         18        SEND_VAR_NO_REF_EX                                       $10
         19        DO_FCALL                                      0          
    6    20    > > JMP                                                      ->10
         21    >   FE_FREE                                                  $8
   12    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.11 ms | 1385 KiB | 13 Q