3v4l.org

run code in 300+ PHP versions simultaneously
<?php class IncrementIterator implements iterator { protected $start; protected $end; protected $current; public function __construct($start, $end) { $this->start = $start; $this->end = $end; } public function rewind() { $this->current = $this->start; } public function valid() { return $this->current <= $this->end; } public function key() { return $this->current; } public function current() { return $this->current; } public function next() { $this->current++; } } $aIterator = new IncrementIterator(0, 26); foreach ($aIterator as $a) { echo "$a\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/MCjOP
function name:  (null)
number of ops:  14
compiled vars:  !0 = $aIterator, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'incrementiterator'
   33     1        NEW                                              $2      'IncrementIterator'
          2        SEND_VAL_EX                                              0
          3        SEND_VAL_EX                                              26
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   35     6      > FE_RESET_R                                       $5      !0, ->12
          7    > > FE_FETCH_R                                               $5, !1, ->12
   36     8    >   NOP                                                      
          9        FAST_CONCAT                                      ~6      !1, '%0A'
         10        ECHO                                                     ~6
   35    11      > JMP                                                      ->7
         12    >   FE_FREE                                                  $5
   37    13      > RETURN                                                   1

Class IncrementIterator:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MCjOP
function name:  __construct
number of ops:  7
compiled vars:  !0 = $start, !1 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        ASSIGN_OBJ                                               'start'
          3        OP_DATA                                                  !0
    9     4        ASSIGN_OBJ                                               'end'
          5        OP_DATA                                                  !1
   10     6      > 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/MCjOP
function name:  rewind
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                      ~1      'start'
          1        ASSIGN_OBJ                                               'current'
          2        OP_DATA                                                  ~1
   14     3      > RETURN                                                   null

End of function rewind

Function valid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MCjOP
function name:  valid
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      'current'
          1        FETCH_OBJ_R                                      ~1      'end'
          2        IS_SMALLER_OR_EQUAL                              ~2      ~0, ~1
          3      > RETURN                                                   ~2
   18     4*     > 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/MCjOP
function name:  key
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                      ~0      'current'
          1      > RETURN                                                   ~0
   22     2*     > 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/MCjOP
function name:  current
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~0      'current'
          1      > RETURN                                                   ~0
   26     2*     > RETURN                                                   null

End of function current

Function next:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MCjOP
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                                              'current'
   30     1      > RETURN                                                   null

End of function next

End of class IncrementIterator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.59 ms | 1399 KiB | 13 Q