3v4l.org

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

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

End of function foo

End of class X.

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

End of function foo

End of class Y.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.34 ms | 1395 KiB | 15 Q