3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Service { protected static $_var = 'S'; public static function test() { echo static::$_var . PHP_EOL; } } class ServiceA extends Service { protected static $_var = 'A'; } class ServiceAB extends ServiceA { protected static $_var = 'AB'; } class ServiceC extends Service { } ServiceA::test(); ServiceAB::test(); ServiceC::test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TbJtS
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_STATIC_METHOD_CALL                                  'ServiceA', 'test'
          1        DO_FCALL                                      0          
   27     2        INIT_STATIC_METHOD_CALL                                  'ServiceAB', 'test'
          3        DO_FCALL                                      0          
   28     4        INIT_STATIC_METHOD_CALL                                  'ServiceC', 'test'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class Service:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TbJtS
function name:  test
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      '_var'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
    9     3      > RETURN                                                   null

End of function test

End of class Service.

Class ServiceA:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TbJtS
function name:  test
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      '_var'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
    9     3      > RETURN                                                   null

End of function test

End of class ServiceA.

Class ServiceAB:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TbJtS
function name:  test
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      '_var'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
    9     3      > RETURN                                                   null

End of function test

End of class ServiceAB.

Class ServiceC:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TbJtS
function name:  test
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      '_var'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
    9     3      > RETURN                                                   null

End of function test

End of class ServiceC.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.03 ms | 1395 KiB | 13 Q