3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NoIteratorBug implements IteratorAggregate { public function getIterator() { return new RecursiveArrayIterator([1, 2, [3, 4, [5, 6]]]); } } $iterator = new RecursiveIteratorIterator(new NoIteratorBug()); foreach ($iterator as $i) { echo $i, PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/Ia7qL
function name:  (null)
number of ops:  14
compiled vars:  !0 = $iterator, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'noiteratorbug'
   11     1        NEW                                              $2      'RecursiveIteratorIterator'
          2        NEW                                              $3      'NoIteratorBug'
          3        DO_FCALL                                      0          
          4        SEND_VAR_NO_REF_EX                                       $3
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $2
   12     7      > FE_RESET_R                                       $7      !0, ->12
          8    > > FE_FETCH_R                                               $7, !1, ->12
   13     9    >   ECHO                                                     !1
         10        ECHO                                                     '%0A'
   12    11      > JMP                                                      ->8
         12    >   FE_FREE                                                  $7
   14    13      > RETURN                                                   1

Class NoIteratorBug:
Function getiterator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ia7qL
function name:  getIterator
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $0      'RecursiveArrayIterator'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3      > RETURN                                                   $0
    8     4*     > RETURN                                                   null

End of function getiterator

End of class NoIteratorBug.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.9 ms | 1394 KiB | 13 Q