3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bla; public function __construct($bla) { $this->bla = $bla; } } class Bar { private $foos; public function __construct($blas) { $this->foos = array(); foreach ($blas as $bla) { $this->foos[] = new Foo($bla); } } public function get($i) { return $this->foos[$i]->bla; } } $bar = new Bar(array(1,2,3,4)); echo $bar->get(1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LJDgH
function name:  (null)
number of ops:  9
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'Bar'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   25     4        INIT_METHOD_CALL                                         !0, 'get'
          5        SEND_VAL_EX                                              1
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
          8      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LJDgH
function name:  __construct
number of ops:  4
compiled vars:  !0 = $bla
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'bla'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

End of class Foo.

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/LJDgH
function name:  __construct
number of ops:  14
compiled vars:  !0 = $blas, !1 = $bla
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ASSIGN_OBJ                                               'foos'
          2        OP_DATA                                                  <array>
   14     3      > FE_RESET_R                                       $3      !0, ->12
          4    > > FE_FETCH_R                                               $3, !1, ->12
   15     5    >   NEW                                              $6      'Foo'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0          
          8        FETCH_OBJ_W                                      $4      'foos'
          9        ASSIGN_DIM                                               $4
         10        OP_DATA                                                  $6
   14    11      > JMP                                                      ->4
         12    >   FE_FREE                                                  $3
   17    13      > RETURN                                                   null

End of function __construct

Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LJDgH
function name:  get
number of ops:  6
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        FETCH_OBJ_R                                      ~1      'foos'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3        FETCH_OBJ_R                                      ~3      ~2, 'bla'
          4      > RETURN                                                   ~3
   21     5*     > RETURN                                                   null

End of function get

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.38 ms | 1403 KiB | 13 Q