3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function x() { echo get_called_class(); } } class B extends A { public static function y() { // I posit these should be _exactly_ the same semantically parent::x(); A::x(); } } B::y();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gtRNW
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'B', 'y'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Class A:
Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gtRNW
function name:  x
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   GET_CALLED_CLASS                                 ~0      
          1        ECHO                                                     ~0
    6     2      > RETURN                                                   null

End of function x

End of class A.

Class B:
Function y:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gtRNW
function name:  y
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_STATIC_METHOD_CALL                                  'x'
          1        DO_FCALL                                      0          
   13     2        INIT_STATIC_METHOD_CALL                                  'A', 'x'
          3        DO_FCALL                                      0          
   14     4      > RETURN                                                   null

End of function y

Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gtRNW
function name:  x
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   GET_CALLED_CLASS                                 ~0      
          1        ECHO                                                     ~0
    6     2      > RETURN                                                   null

End of function x

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.81 ms | 1394 KiB | 13 Q