3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FirstClass { public $options; public function __construct() { $this->options = ['yay']; //get_option('theme_options'); //wordpress fn } public function myFunction() { // } } class SecondClass extends FirstClass { } class ThirdClass extends FirstClass { } $secondClass = new SecondClass(); var_dump($secondClass->options); $thirdClass = new ThirdClass(); var_dump($thirdClass->options);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LVdAg
function name:  (null)
number of ops:  15
compiled vars:  !0 = $secondClass, !1 = $thirdClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $2      'SecondClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   29     3        INIT_FCALL                                               'var_dump'
          4        FETCH_OBJ_R                                      ~5      !0, 'options'
          5        SEND_VAL                                                 ~5
          6        DO_ICALL                                                 
   31     7        NEW                                              $7      'ThirdClass'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
   32    10        INIT_FCALL                                               'var_dump'
         11        FETCH_OBJ_R                                      ~10     !1, 'options'
         12        SEND_VAL                                                 ~10
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class FirstClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LVdAg
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN_OBJ                                               'options'
          1        OP_DATA                                                  <array>
   10     2      > RETURN                                                   null

End of function __construct

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

End of function myfunction

End of class FirstClass.

Class SecondClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LVdAg
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN_OBJ                                               'options'
          1        OP_DATA                                                  <array>
   10     2      > RETURN                                                   null

End of function __construct

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

End of function myfunction

End of class SecondClass.

Class ThirdClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LVdAg
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN_OBJ                                               'options'
          1        OP_DATA                                                  <array>
   10     2      > RETURN                                                   null

End of function __construct

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

End of function myfunction

End of class ThirdClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.2 ms | 1015 KiB | 14 Q