3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bla implements Iterator { private $pos = 0; public function __construct() { $this->pos = 0; } function rewind() { $this->pos = 0; } function current() { return $this->pos; } function key() { return $this->pos; } function next() { $this->pos++; } function valid() { return pos < 3; } } echo "results:"; $bla = new Bla(); $i = 0; foreach($bla as $a) { $i++; foreach ($bla as $b) { echo "($a, $b)<br />"; } if ($i > 5) break; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 23
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 23
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 18
Branch analysis from position: 23
Branch analysis from position: 23
filename:       /in/EKp5H
function name:  (null)
number of ops:  25
compiled vars:  !0 = $bla, !1 = $i, !2 = $a, !3 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'bla'
   39     1        ECHO                                                     'results%3A'
   41     2        NEW                                              $4      'Bla'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $4
   42     5        ASSIGN                                                   !1, 0
   44     6      > FE_RESET_R                                       $8      !0, ->23
          7    > > FE_FETCH_R                                               $8, !2, ->23
   46     8    >   PRE_INC                                                  !1
   48     9      > FE_RESET_R                                       $10     !0, ->18
         10    > > FE_FETCH_R                                               $10, !3, ->18
   50    11    >   ROPE_INIT                                     5  ~12     '%28'
         12        ROPE_ADD                                      1  ~12     ~12, !2
         13        ROPE_ADD                                      2  ~12     ~12, '%2C+'
         14        ROPE_ADD                                      3  ~12     ~12, !3
         15        ROPE_END                                      4  ~11     ~12, '%29%3Cbr+%2F%3E'
         16        ECHO                                                     ~11
   48    17      > JMP                                                      ->10
         18    >   FE_FREE                                                  $10
   53    19        IS_SMALLER                                               5, !1
         20      > JMPZ                                                     ~15, ->22
         21    > > JMP                                                      ->23
   44    22    > > JMP                                                      ->7
         23    >   FE_FREE                                                  $8
   54    24      > RETURN                                                   1

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

End of function __construct

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

End of function rewind

Function current:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EKp5H
function name:  current
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_OBJ_R                                      ~0      'pos'
          1      > RETURN                                                   ~0
   20     2*     > 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/EKp5H
function name:  key
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   FETCH_OBJ_R                                      ~0      'pos'
          1      > RETURN                                                   ~0
   25     2*     > 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/EKp5H
function name:  next
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   PRE_INC_OBJ                                              'pos'
   30     1      > 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/EKp5H
function name:  valid
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   FETCH_CONSTANT                                   ~0      'pos'
          1        IS_SMALLER                                       ~1      ~0, 3
          2      > RETURN                                                   ~1
   35     3*     > RETURN                                                   null

End of function valid

End of class Bla.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.34 ms | 1399 KiB | 13 Q