3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace bar; class X { const FOO="foo"; public static function foo() { return static::FOO; } } class Y extends X { const FOO="bar"; } print_r(Y::foo()); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VZ2oM
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_NS_FCALL_BY_NAME                                    'bar%5Cprint_r'
          1        INIT_STATIC_METHOD_CALL                                  'bar%5CY', 'foo'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR_NO_REF_EX                                       $0
          4        DO_FCALL                                      0          
   16     5      > RETURN                                                   1

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

End of function foo

End of class bar\X.

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

End of function foo

End of class bar\Y.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.28 ms | 1399 KiB | 15 Q