3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function name() { return self::class; } } class B extends A {} echo (new A())->name(); echo (new B())->name(); class AA { public function name() { return static::class; } } class BA extends AA {} echo (new AA())->name(); echo (new BA())->name();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UQThY
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $0      'A'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'name'
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   12     5        NEW                                              $3      'B'
          6        DO_FCALL                                      0          
          7        INIT_METHOD_CALL                                         $3, 'name'
          8        DO_FCALL                                      0  $5      
          9        ECHO                                                     $5
   22    10        NEW                                              $6      'AA'
         11        DO_FCALL                                      0          
         12        INIT_METHOD_CALL                                         $6, 'name'
         13        DO_FCALL                                      0  $8      
         14        ECHO                                                     $8
   23    15        NEW                                              $9      'BA'
         16        DO_FCALL                                      0          
         17        INIT_METHOD_CALL                                         $9, 'name'
         18        DO_FCALL                                      0  $11     
         19        ECHO                                                     $11
         20      > RETURN                                                   1

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

End of function name

End of class A.

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

End of function name

End of class B.

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

End of function name

End of class AA.

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

End of function name

End of class BA.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.9 ms | 1399 KiB | 13 Q