3v4l.org

run code in 500+ PHP versions simultaneously
<?php class MyClass { public static $var = 'yay!'; public $childClass; public function __construct() { $this->childClass = new ChildClass(); } } class ChildClass { public static $var = 'yay?'; } $obj = new MyClass(); echo $obj::$var; // works echo $obj->childClass::$var; // syntax error ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ad03D
function name:  (null)
number of ops:  11
compiled vars:  !0 = $obj
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   NEW                                                  $1      'MyClass'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   24     3        FETCH_CLASS                                       0  $4      !0
          4        FETCH_STATIC_PROP_R              global lock         ~5      'var'
          5        ECHO                                                         ~5
   25     6        FETCH_OBJ_R                                          ~6      !0, 'childClass'
          7        FETCH_CLASS                                       0  $7      ~6
          8        FETCH_STATIC_PROP_R              unknown             ~8      'var'
          9        ECHO                                                         ~8
   27    10      > RETURN                                                       1

Class MyClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ad03D
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   NEW                                                  $1      'ChildClass'
          1        DO_FCALL                                          0          
          2        ASSIGN_OBJ                                                   'childClass'
          3        OP_DATA                                                      $1
   12     4      > RETURN                                                       null

End of function __construct

End of class MyClass.

Class ChildClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
227.95 ms | 1968 KiB | 8 Q