3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class A { public $property; public function __construct( $prop ) { echo $this->property = $prop; } public function returnValue(){ return 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' ); print $B->returnValue();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Upb6T
function name:  (null)
number of ops:  8
compiled vars:  !0 = $B
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'B'
          1        SEND_VAL_EX                                              'property_one'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   25     4        INIT_METHOD_CALL                                         !0, 'returnValue'
          5        DO_FCALL                                      0  $4      
          6        ECHO                                                     $4
          7      > RETURN                                                   1

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

End of function __construct

Function returnvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Upb6T
function name:  returnValue
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'property'
          1        FETCH_STATIC_PROP_R          unknown             ~1      ~0
          2      > RETURN                                                   ~1
   13     3*     > RETURN                                                   null

End of function returnvalue

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/Upb6T
function name:  __construct
number of ops:  5
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                       ~1      'property'
          2        OP_DATA                                                  !0
          3        ECHO                                                     ~1
   10     4      > RETURN                                                   null

End of function __construct

Function returnvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Upb6T
function name:  returnValue
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'property'
          1        FETCH_STATIC_PROP_R          unknown             ~1      ~0
          2      > RETURN                                                   ~1
   13     3*     > RETURN                                                   null

End of function returnvalue

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.8 ms | 1399 KiB | 13 Q