3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Dad { static function getStatic() { return new static; } static function getSelf() { return new self; } } trait Useless { static function getStatic() { return new static; } } final class A extends Dad { use Useless; static function getSelf() { return new self; } } var_dump(A::getStatic()::class); var_dump(A::getSelf()::class);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CsmAr
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   DECLARE_CLASS                                                'a', 'dad'
   27     1        INIT_FCALL                                                   'var_dump'
          2        INIT_STATIC_METHOD_CALL                                      'A', 'getStatic'
          3        DO_FCALL                                          0  $0      
          4        FETCH_CLASS_NAME                                     ~1      $0
          5        SEND_VAL                                                     ~1
          6        DO_ICALL                                                     
   28     7        INIT_FCALL                                                   'var_dump'
          8        INIT_STATIC_METHOD_CALL                                      'A', 'getSelf'
          9        DO_FCALL                                          0  $3      
         10        FETCH_CLASS_NAME                                     ~4      $3
         11        SEND_VAL                                                     ~4
         12        DO_ICALL                                                     
         13      > RETURN                                                       1

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

End of function getstatic

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

End of function getself

End of class Dad.

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

End of function getstatic

End of class Useless.

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

End of function getself

End of class A.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
151.87 ms | 1474 KiB | 14 Q