3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function get_self() { return new self(); } public static function get_static() { return new static(); } } class B extends A {} class C extends B {} echo get_class(C::get_self()); // A echo get_class(C::get_static()); // B
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qYRb9
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_STATIC_METHOD_CALL                                  'C', 'get_self'
          1        DO_FCALL                                      0  $0      
          2        GET_CLASS                                        ~1      $0
          3        ECHO                                                     ~1
   17     4        INIT_STATIC_METHOD_CALL                                  'C', 'get_static'
          5        DO_FCALL                                      0  $2      
          6        GET_CLASS                                        ~3      $2
          7        ECHO                                                     ~3
          8      > RETURN                                                   1

Class A:
Function get_self:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qYRb9
function name:  get_self
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                          self                $0      
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    5     3*     > RETURN                                                   null

End of function get_self

Function get_static:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qYRb9
function name:  get_static
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                          static              $0      
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    9     3*     > RETURN                                                   null

End of function get_static

End of class A.

Class B:
Function get_self:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qYRb9
function name:  get_self
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                          self                $0      
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    5     3*     > RETURN                                                   null

End of function get_self

Function get_static:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qYRb9
function name:  get_static
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                          static              $0      
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    9     3*     > RETURN                                                   null

End of function get_static

End of class B.

Class C:
Function get_self:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qYRb9
function name:  get_self
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                          self                $0      
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    5     3*     > RETURN                                                   null

End of function get_self

Function get_static:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qYRb9
function name:  get_static
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                          static              $0      
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    9     3*     > RETURN                                                   null

End of function get_static

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.45 ms | 1399 KiB | 13 Q