3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { public $a = ["a"=>"red","b"=>"white","c"=>"blue"]; private $b = ["d"=>"turquoise","e"=>"magenta"]; public function getIterator(){ return (new ArrayObject( $this->a + $this->b ))->getIterator(); } } $it = (new test())->getIterator(); foreach ($it as $k => $v){ echo $k,". ",$v,"\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/oBEll
function name:  (null)
number of ops:  15
compiled vars:  !0 = $it, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $3      'test'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $3, 'getIterator'
          3        DO_FCALL                                      0  $5      
          4        ASSIGN                                                   !0, $5
   13     5      > FE_RESET_R                                       $7      !0, ->13
          6    > > FE_FETCH_R                                       ~8      $7, !1, ->13
          7    >   ASSIGN                                                   !2, ~8
   14     8        ECHO                                                     !2
          9        ECHO                                                     '.+'
         10        ECHO                                                     !1
         11        ECHO                                                     '%0A'
   13    12      > JMP                                                      ->6
         13    >   FE_FREE                                                  $7
   15    14      > RETURN                                                   1

Class test:
Function getiterator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oBEll
function name:  getIterator
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $0      'ArrayObject'
          1        FETCH_OBJ_R                                      ~1      'a'
          2        FETCH_OBJ_R                                      ~2      'b'
          3        ADD                                              ~3      ~1, ~2
          4        SEND_VAL_EX                                              ~3
          5        DO_FCALL                                      0          
          6        INIT_METHOD_CALL                                         $0, 'getIterator'
          7        DO_FCALL                                      0  $5      
          8      > RETURN                                                   $5
   10     9*     > RETURN                                                   null

End of function getiterator

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.62 ms | 1395 KiB | 13 Q