3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { foreach ([] as $foo) { } } $iterator = new AppendIterator(); $iterator->append(foo()); var_dump(iterator_to_array($iterator));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V0F0K
function name:  (null)
number of ops:  15
compiled vars:  !0 = $iterator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'AppendIterator'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    8     3        INIT_METHOD_CALL                                         !0, 'append'
          4        INIT_FCALL                                               'foo'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR_NO_REF_EX                                       $4
          7        DO_FCALL                                      0          
    9     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'iterator_to_array'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 1, Position 2 = 3
Branch analysis from position: 1
2 jumps found. (Code = 78) Position 1 = 2, Position 2 = 3
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
filename:       /in/V0F0K
function name:  foo
number of ops:  5
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > FE_RESET_R                                       $1      <array>, ->3
          1    > > FE_FETCH_R                                               $1, !0, ->3
          2    > > JMP                                                      ->1
          3    >   FE_FREE                                                  $1
    6     4      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.59 ms | 1398 KiB | 18 Q