3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Qux { public static function bar() { } } class Foo { use Qux; } $reflectionTrait = new ReflectionMethod('Qux', 'bar'); $reflectionClass = new ReflectionMethod('Foo', 'bar'); var_dump($reflectionTrait->getDeclaringClass()->getName()); var_dump($reflectionClass->getDeclaringClass()->getName());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vUVLr
function name:  (null)
number of ops:  26
compiled vars:  !0 = $reflectionTrait, !1 = $reflectionClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                            'foo'
   16     1        NEW                                              $2      'ReflectionMethod'
          2        SEND_VAL_EX                                              'Qux'
          3        SEND_VAL_EX                                              'bar'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   17     6        NEW                                              $5      'ReflectionMethod'
          7        SEND_VAL_EX                                              'Foo'
          8        SEND_VAL_EX                                              'bar'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $5
   19    11        INIT_FCALL                                               'var_dump'
         12        INIT_METHOD_CALL                                         !0, 'getDeclaringClass'
         13        DO_FCALL                                      0  $8      
         14        INIT_METHOD_CALL                                         $8, 'getName'
         15        DO_FCALL                                      0  $9      
         16        SEND_VAR                                                 $9
         17        DO_ICALL                                                 
   20    18        INIT_FCALL                                               'var_dump'
         19        INIT_METHOD_CALL                                         !1, 'getDeclaringClass'
         20        DO_FCALL                                      0  $11     
         21        INIT_METHOD_CALL                                         $11, 'getName'
         22        DO_FCALL                                      0  $12     
         23        SEND_VAR                                                 $12
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

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

End of function bar

End of class Qux.

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.35 ms | 1396 KiB | 15 Q