3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class A { public $property; public function __construct( $prop ) { $this->property = $prop; print static::${$this->property}; } } Class B extends A { public static $property_one = 'This is first property'; public static $property_two = 'This is second property'; } $B = new B( 'property_one' );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Omb16
function name:  (null)
number of ops:  5
compiled vars:  !0 = $B
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'B'
          1        SEND_VAL_EX                                              'property_one'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
          4      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Omb16
function name:  __construct
number of ops:  7
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'property'
          2        OP_DATA                                                  !0
    9     3        FETCH_OBJ_R                                      ~2      'property'
          4        FETCH_STATIC_PROP_R          unknown             ~3      ~2
          5        ECHO                                                     ~3
   10     6      > 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/Omb16
function name:  __construct
number of ops:  7
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'property'
          2        OP_DATA                                                  !0
    9     3        FETCH_OBJ_R                                      ~2      'property'
          4        FETCH_STATIC_PROP_R          unknown             ~3      ~2
          5        ECHO                                                     ~3
   10     6      > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.25 ms | 1385 KiB | 13 Q