3v4l.org

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

Class ParentClass: [no user functions]
Class ChildClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.01 ms | 1395 KiB | 13 Q