3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f( Traversable $obj ){ foreach ($obj as $k => $v){ echo $v . "\n"; } } class test2 implements IteratorAggregate { public $bla = 'a'; public $blee = 'b'; public $blu = 'c'; public function getIterator() { return new ArrayIterator( $this ); } } $t2 = new test2; f($t2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kA02a
function name:  (null)
number of ops:  8
compiled vars:  !0 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'test2'
   17     1        NEW                                              $1      'test2'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   18     4        INIT_FCALL                                               'f'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/kA02a
function name:  f
number of ops:  9
compiled vars:  !0 = $obj, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1      > FE_RESET_R                                       $3      !0, ->7
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->7
          3    >   ASSIGN                                                   !2, ~4
    4     4        CONCAT                                           ~6      !1, '%0A'
          5        ECHO                                                     ~6
    3     6      > JMP                                                      ->2
          7    >   FE_FREE                                                  $3
    6     8      > RETURN                                                   null

End of function f

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

End of function getiterator

End of class test2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.16 ms | 1399 KiB | 14 Q