3v4l.org

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

Class Baz: [no user functions]
Class Test:
Function key:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NtRMD
function name:  key
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $0      'Baz'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    9     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/NtRMD
function name:  next
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   null

End of function next

Function valid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NtRMD
function name:  valid
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   PRE_INC_OBJ                                              'count'
          1        FETCH_OBJ_R                                      ~1      'count'
          2        IS_SMALLER                                       ~2      ~1, 4
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of function valid

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

End of function current

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

End of function rewind

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.64 ms | 1400 KiB | 15 Q