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; function arrara() { 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/kHqGX
function name:  (null)
number of ops:  9
compiled vars:  !0 = $bla, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'bla'
   39     1        ECHO                                                     'results%3A'
   41     2        NEW                                              $2      'Bla'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   42     5        ASSIGN                                                   !1, 0
   59     6        INIT_FCALL                                               'arrara'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

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