3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A implements IteratorAggregate{ public function getIterator(){ return new B(); } } class B implements IteratorAggregate{ public function getIterator(){ return new C(); } } class C implements IteratorAggregate{ public function getIterator(){ return new ArrayIterator(array(1, 2, 3, 4, 5)); } } $a = new A(); foreach ($a as $aa){ echo $aa; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/fEv5T
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $aa
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'a'
    8     1        DECLARE_CLASS                                            'b'
   13     2        DECLARE_CLASS                                            'c'
   18     3        NEW                                              $2      'A'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   19     6      > FE_RESET_R                                       $5      !0, ->10
          7    > > FE_FETCH_R                                               $5, !1, ->10
   20     8    >   ECHO                                                     !1
   19     9      > JMP                                                      ->7
         10    >   FE_FREE                                                  $5
   21    11      > RETURN                                                   1

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

End of function getiterator

End of class A.

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

End of function getiterator

End of class B.

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

End of function getiterator

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.51 ms | 1399 KiB | 13 Q