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:"; function arrara() { $bla = new Bla(); $i = 0; foreach($bla as $a) { foreach ($bla as $b) { echo "($a, $b)<br />"; $i++; if ($i > 20) return; } if ($i > 20) return; } } arrara();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oA9ZI
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'bla'
   39     1        ECHO                                                     'results%3A'
   59     2        INIT_FCALL                                               'arrara'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function arrara:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 27
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 27
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 21
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 21
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/oA9ZI
function name:  arrara
number of ops:  29
compiled vars:  !0 = $bla, !1 = $i, !2 = $a, !3 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   NEW                                              $4      'Bla'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   44     3        ASSIGN                                                   !1, 0
   46     4      > FE_RESET_R                                       $8      !0, ->27
          5    > > FE_FETCH_R                                               $8, !2, ->27
   48     6    > > FE_RESET_R                                       $9      !0, ->21
          7    > > FE_FETCH_R                                               $9, !3, ->21
   50     8    >   ROPE_INIT                                     5  ~11     '%28'
          9        ROPE_ADD                                      1  ~11     ~11, !2
         10        ROPE_ADD                                      2  ~11     ~11, '%2C+'
         11        ROPE_ADD                                      3  ~11     ~11, !3
         12        ROPE_END                                      4  ~10     ~11, '%29%3Cbr+%2F%3E'
         13        ECHO                                                     ~10
   51    14        PRE_INC                                                  !1
   52    15        IS_SMALLER                                               20, !1
         16      > JMPZ                                                     ~15, ->20
         17    >   FE_FREE                                                  $9
         18        FE_FREE                                                  $8
         19      > RETURN                                                   null
   48    20    > > JMP                                                      ->7
         21    >   FE_FREE                                                  $9
   55    22        IS_SMALLER                                               20, !1
         23      > JMPZ                                                     ~16, ->26
         24    >   FE_FREE                                                  $8
         25      > RETURN                                                   null
   46    26    > > JMP                                                      ->5
         27    >   FE_FREE                                                  $8
   57    28      > RETURN                                                   null

End of function arrara

Class Bla:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oA9ZI
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/oA9ZI
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/oA9ZI
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/oA9ZI
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/oA9ZI
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/oA9ZI
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:
161.44 ms | 1407 KiB | 14 Q