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().PHP_EOL; echo (new B())->name().PHP_EOL; class AA { public function name() { return static::class; } } class BA extends AA {} echo (new AA())->name().PHP_EOL; echo (new BA())->name().PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t73d7
function name:  (null)
number of ops:  25
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        CONCAT                                           ~3      $2, '%0A'
          5        ECHO                                                     ~3
   12     6        NEW                                              $4      'B'
          7        DO_FCALL                                      0          
          8        INIT_METHOD_CALL                                         $4, 'name'
          9        DO_FCALL                                      0  $6      
         10        CONCAT                                           ~7      $6, '%0A'
         11        ECHO                                                     ~7
   22    12        NEW                                              $8      'AA'
         13        DO_FCALL                                      0          
         14        INIT_METHOD_CALL                                         $8, 'name'
         15        DO_FCALL                                      0  $10     
         16        CONCAT                                           ~11     $10, '%0A'
         17        ECHO                                                     ~11
   23    18        NEW                                              $12     'BA'
         19        DO_FCALL                                      0          
         20        INIT_METHOD_CALL                                         $12, 'name'
         21        DO_FCALL                                      0  $14     
         22        CONCAT                                           ~15     $14, '%0A'
         23        ECHO                                                     ~15
         24      > RETURN                                                   1

Class A:
Function name:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t73d7
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/t73d7
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/t73d7
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/t73d7
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:
144.42 ms | 1414 KiB | 13 Q