3v4l.org

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

Class Foo:
Function current:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U0gKD
function name:  current
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   FETCH_THIS                                           ~0      
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
          3*       VERIFY_RETURN_TYPE                                           
          4*     > 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/U0gKD
function name:  key
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   FETCH_THIS                                           ~0      
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
          3*       VERIFY_RETURN_TYPE                                           
          4*     > 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/U0gKD
function name:  next
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     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/U0gKD
function name:  rewind
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     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/U0gKD
function name:  valid
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                       <true>
          1*       VERIFY_RETURN_TYPE                                           
          2*     > RETURN                                                       null

End of function valid

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
204.44 ms | 2102 KiB | 14 Q