3v4l.org

run code in 500+ PHP versions simultaneously
<?php class RootClass { public static function getStaticName() { echo 'get_called_class(): ' . get_called_class(). "\n"; echo 'static::$class: ' . static::$class . "\n"; } public function getName() { static::getStaticName(); } } class SubClass extends RootClass {} $instance = new SubClass(); $instance::getStaticName();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c24ea
function name:  (null)
number of ops:  7
compiled vars:  !0 = $instance
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   NEW                                                  $1      'SubClass'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   16     3        FETCH_CLASS                                       0  $4      !0
          4        INIT_STATIC_METHOD_CALL                                      $4, 'getStaticName'
          5        DO_FCALL                                          0          
          6      > RETURN                                                       1

Class RootClass:
Function getstaticname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c24ea
function name:  getStaticName
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   GET_CALLED_CLASS                                     ~0      
          1        CONCAT                                               ~1      'get_called_class%28%29%3A+', ~0
          2        CONCAT                                               ~2      ~1, '%0A'
          3        ECHO                                                         ~2
    6     4        FETCH_STATIC_PROP_R              unknown             ~3      'class'
          5        CONCAT                                               ~4      'static%3A%3A%24class%3A+', ~3
          6        CONCAT                                               ~5      ~4, '%0A'
          7        ECHO                                                         ~5
    7     8      > RETURN                                                       null

End of function getstaticname

Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c24ea
function name:  getName
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_STATIC_METHOD_CALL                                      'getStaticName'
          1        DO_FCALL                                          0          
   10     2      > RETURN                                                       null

End of function getname

End of class RootClass.

Class SubClass:
Function getstaticname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c24ea
function name:  getStaticName
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   GET_CALLED_CLASS                                     ~0      
          1        CONCAT                                               ~1      'get_called_class%28%29%3A+', ~0
          2        CONCAT                                               ~2      ~1, '%0A'
          3        ECHO                                                         ~2
    6     4        FETCH_STATIC_PROP_R              unknown             ~3      'class'
          5        CONCAT                                               ~4      'static%3A%3A%24class%3A+', ~3
          6        CONCAT                                               ~5      ~4, '%0A'
          7        ECHO                                                         ~5
    7     8      > RETURN                                                       null

End of function getstaticname

Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c24ea
function name:  getName
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_STATIC_METHOD_CALL                                      'getStaticName'
          1        DO_FCALL                                          0          
   10     2      > RETURN                                                       null

End of function getname

End of class SubClass.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.64 ms | 2066 KiB | 8 Q