3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ParentClass { public static $prop; public static function setProp($prop) { self::$prop = $prop; } } class ChildClass extends ParentClass { } ParentClass::$prop = "first"; $parent = new ParentClass; echo "parent 1: " . $parent::$prop; ChildClass::$prop = "second"; $child = new ChildClass; echo "child 1: " . $child::$prop; echo "parent 2: " . $parent::$prop;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/07EPV
function name:  (null)
number of ops:  23
compiled vars:  !0 = $parent, !1 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN_STATIC_PROP                                       'prop', 'ParentClass'
          1        OP_DATA                                                  'first'
   17     2        NEW                                              $3      'ParentClass'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   18     5        FETCH_CLASS                                   0  $6      !0
          6        FETCH_STATIC_PROP_R          unknown             ~7      'prop'
          7        CONCAT                                           ~8      'parent+1%3A+', ~7
          8        ECHO                                                     ~8
   20     9        ASSIGN_STATIC_PROP                                       'prop', 'ChildClass'
         10        OP_DATA                                                  'second'
   21    11        NEW                                              $10     'ChildClass'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !1, $10
   22    14        FETCH_CLASS                                   0  $13     !1
         15        FETCH_STATIC_PROP_R          unknown             ~14     'prop'
         16        CONCAT                                           ~15     'child+1%3A+', ~14
         17        ECHO                                                     ~15
   23    18        FETCH_CLASS                                   0  $16     !0
         19        FETCH_STATIC_PROP_R          unknown             ~17     'prop'
         20        CONCAT                                           ~18     'parent+2%3A+', ~17
         21        ECHO                                                     ~18
         22      > RETURN                                                   1

Class ParentClass:
Function setprop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/07EPV
function name:  setProp
number of ops:  4
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ASSIGN_STATIC_PROP                                       'prop'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function setprop

End of class ParentClass.

Class ChildClass:
Function setprop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/07EPV
function name:  setProp
number of ops:  4
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ASSIGN_STATIC_PROP                                       'prop'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function setprop

End of class ChildClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.29 ms | 1395 KiB | 13 Q