3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example implements Iterator { public $i = 0; public $prop = 'pie'; public function rewind() { $this->i = 0;} public function next() {} public function valid() { return ($this->i++ < 5); } public function key() { return 7; } public function current() { return $this->prop; } } $it = new Example; foreach ($it as &$current) { $current = str_rot13($current); } var_dump($it);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
2 jumps found. (Code = 126) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/pdaNO
function name:  (null)
number of ops:  16
compiled vars:  !0 = $it, !1 = $current
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'example'
   14     1        NEW                                              $2      'Example'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   16     4      > FE_RESET_RW                                      $5      !0, ->11
          5    > > FE_FETCH_RW                                              $5, !1, ->11
   17     6    >   INIT_FCALL                                               'str_rot13'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !1, $6
   16    10      > JMP                                                      ->5
         11    >   FE_FREE                                                  $5
   20    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

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

End of function rewind

Function next:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pdaNO
function name:  next
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     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/pdaNO
function name:  valid
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   POST_INC_OBJ                                     ~0      'i'
          1        IS_SMALLER                                       ~1      ~0, 5
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function valid

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

End of function key

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

End of function current

End of class Example.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.62 ms | 1407 KiB | 17 Q