3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Base { protected static $var = 1; public function foo() { echo static::$var; } } class Extended extends Base { protected static $var = 2; } $a = new Base(); $b = new Extended(); $a->foo(); echo "\n"; $b->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rDkvl
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   NEW                                                  $2      'Base'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   16     3        NEW                                                  $5      'Extended'
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !1, $5
   18     6        INIT_METHOD_CALL                                             !0, 'foo'
          7        DO_FCALL                                          0          
   19     8        ECHO                                                         '%0A'
   20     9        INIT_METHOD_CALL                                             !1, 'foo'
         10        DO_FCALL                                          0          
         11      > RETURN                                                       1

Class Base:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rDkvl
function name:  foo
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   FETCH_STATIC_PROP_R              unknown             ~0      'var'
          1        ECHO                                                         ~0
    8     2      > RETURN                                                       null

End of function foo

End of class Base.

Class Extended:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rDkvl
function name:  foo
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   FETCH_STATIC_PROP_R              unknown             ~0      'var'
          1        ECHO                                                         ~0
    8     2      > RETURN                                                       null

End of function foo

End of class Extended.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
125.46 ms | 475 KiB | 7 Q