3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait MyTrait { public function foo() { } } class MyClass { public function foo() { } } class Test extends MyClass { use MyTrait; } $refl = new \ReflectionClass('Test'); var_dump($refl->getMethod('foo')->getPrototype());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dZcQB
function name:  (null)
number of ops:  14
compiled vars:  !0 = $refl
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   DECLARE_CLASS                                            'test', 'myclass'
   22     1        NEW                                              $1      'ReflectionClass'
          2        SEND_VAL_EX                                              'Test'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   24     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'getMethod'
          7        SEND_VAL_EX                                              'foo'
          8        DO_FCALL                                      0  $4      
          9        INIT_METHOD_CALL                                         $4, 'getPrototype'
         10        DO_FCALL                                      0  $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class MyTrait:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dZcQB
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 MyTrait.

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

End of function foo

End of class MyClass.

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.81 ms | 1395 KiB | 15 Q