3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function getStatic() { return get_class(new static); } public function getCalledClass() { return get_called_class(); } public static function sGetStatic() { return get_class(new static); } public static function sGetCalledClass() { return get_called_class(); } } class B extends A { } $b = new B; var_dump($b->getStatic()); $b = new B; var_dump($b->getCalledClass()); var_dump(B::sGetStatic()); var_dump(B::sGetCalledClass());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WlM7l
function name:  (null)
number of ops:  27
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'getStatic'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
   12     8        NEW                                              $6      'B'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !0, $6
         11        INIT_FCALL                                               'var_dump'
         12        INIT_METHOD_CALL                                         !0, 'getCalledClass'
         13        DO_FCALL                                      0  $9      
         14        SEND_VAR                                                 $9
         15        DO_ICALL                                                 
   13    16        INIT_FCALL                                               'var_dump'
         17        INIT_STATIC_METHOD_CALL                                  'B', 'sGetStatic'
         18        DO_FCALL                                      0  $11     
         19        SEND_VAR                                                 $11
         20        DO_ICALL                                                 
   14    21        INIT_FCALL                                               'var_dump'
         22        INIT_STATIC_METHOD_CALL                                  'B', 'sGetCalledClass'
         23        DO_FCALL                                      0  $13     
         24        SEND_VAR                                                 $13
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

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

End of function getstatic

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

End of function getcalledclass

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

End of function sgetstatic

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

End of function sgetcalledclass

End of class A.

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

End of function getstatic

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

End of function getcalledclass

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

End of function sgetstatic

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

End of function sgetcalledclass

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.77 ms | 1404 KiB | 15 Q