3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected const TEST = 'test'; public static function echoConst(): void { echo static::TEST; } } class Bar extends Foo { protected const TEST = 'shuyalinet'; } Bar::echoConst();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lgNfS
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_STATIC_METHOD_CALL                                  'Bar', 'echoConst'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

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

End of function echoconst

End of class Foo.

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

End of function echoconst

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.22 ms | 994 KiB | 13 Q