3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a; public function __construct(){ $this->a["index"] = new B(); } } class B { public function someFunction(){ return "NULL"; } } $o = new A(); echo $o->a["index"]->someFunction() ?? "Something";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/inUFt
function name:  (null)
number of ops:  11
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        FETCH_OBJ_R                                      ~4      !0, 'a'
          4        FETCH_DIM_R                                      ~5      ~4, 'index'
          5        INIT_METHOD_CALL                                         ~5, 'someFunction'
          6        DO_FCALL                                      0  $6      
          7        COALESCE                                         ~7      $6
          8        QM_ASSIGN                                        ~7      'Something'
          9        ECHO                                                     ~7
         10      > RETURN                                                   1

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

End of function __construct

End of class A.

Class B:
Function somefunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/inUFt
function name:  someFunction
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   'NULL'
   14     1*     > RETURN                                                   null

End of function somefunction

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.89 ms | 1394 KiB | 13 Q