3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test implements Iterator { public function current() { return "value"; } public function key() { return new stdClass; } public function next() { } public function rewind() { } public function valid() { return true; } } $test = new Test; foreach ($test as $key => $value) { var_dump($key, $value); break; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 13
filename:       /in/VU5Df
function name:  (null)
number of ops:  15
compiled vars:  !0 = $test, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'test'
   31     1        NEW                                              $3      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   32     4      > FE_RESET_R                                       $6      !0, ->13
          5    > > FE_FETCH_R                                       ~7      $6, !1, ->13
          6    >   ASSIGN                                                   !2, ~7
   33     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
   34    11      > JMP                                                      ->13
   32    12*       JMP                                                      ->5
         13    >   FE_FREE                                                  $6
   35    14      > RETURN                                                   1

Class Test:
Function current:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VU5Df
function name:  current
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   'value'
    8     1*     > RETURN                                                   null

End of function current

Function key:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VU5Df
function name:  key
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $0      'stdClass'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   13     3*     > RETURN                                                   null

End of function key

Function next:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VU5Df
function name:  next
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E > > RETURN                                                   null

End of function next

Function rewind:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VU5Df
function name:  rewind
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E > > RETURN                                                   null

End of function rewind

Function valid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VU5Df
function name:  valid
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E > > RETURN                                                   <true>
   28     1*     > RETURN                                                   null

End of function valid

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.09 ms | 1400 KiB | 15 Q