3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait A { function foo() { } } class C { use A { A::foo as alias; } } $rm = new ReflectionMethod('C', 'alias'); echo $rm->name; echo "\n"; echo (new ReflectionClass('C'))->getMethod('alias')->name;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nlm9C
function name:  (null)
number of ops:  18
compiled vars:  !0 = $rm
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                                'c'
   17     1        NEW                                                  $1      'ReflectionMethod'
          2        SEND_VAL_EX                                                  'C'
          3        SEND_VAL_EX                                                  'alias'
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !0, $1
   18     6        FETCH_OBJ_R                                          ~4      !0, 'name'
          7        ECHO                                                         ~4
   19     8        ECHO                                                         '%0A'
   20     9        NEW                                                  $5      'ReflectionClass'
         10        SEND_VAL_EX                                                  'C'
         11        DO_FCALL                                          0          
         12        INIT_METHOD_CALL                                             $5, 'getMethod'
         13        SEND_VAL_EX                                                  'alias'
         14        DO_FCALL                                          0  $7      
         15        FETCH_OBJ_R                                          ~8      $7, 'name'
         16        ECHO                                                         ~8
   21    17      > RETURN                                                       1

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

End of function foo

End of class A.

Class C: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.37 ms | 3270 KiB | 13 Q