3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $classB, $classC; public function __construct(){ // Do stuff that should only be initialized once // Then later : $this -> classB = new B(); $this -> classC = new C(); } } Class B { public function __construct(){ } public function sayHi() { echo 'hi'; } } Class C extends A { public function __construct() { $this -> classB -> sayHi(); } } $test = new A();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SVBNm
function name:  (null)
number of ops:  4
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

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

End of function __construct

End of class A.

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

End of function __construct

Function sayhi:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SVBNm
function name:  sayHi
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ECHO                                                     'hi'
   20     1      > RETURN                                                   null

End of function sayhi

End of class B.

Class C:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SVBNm
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~0      'classB'
          1        INIT_METHOD_CALL                                         ~0, 'sayHi'
          2        DO_FCALL                                      0          
   26     3      > RETURN                                                   null

End of function __construct

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.93 ms | 1395 KiB | 13 Q