3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface InterfaceWithMethod { function foo(); } trait SimpleTrait { function foo() { return __CLASS__; } } class ClassWithTraitAndInterface implements InterfaceWithMethod { use SimpleTrait; } echo ReflectionMethod::export(ClassWithTraitAndInterface::class, 'foo'); echo (new ReflectionMethod(ClassWithTraitAndInterface::class, 'foo'))->getPrototype();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LLebD
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_CLASS                                            'classwithtraitandinterface'
   17     1        INIT_STATIC_METHOD_CALL                                  'ReflectionMethod', 'export'
          2        SEND_VAL_EX                                              'ClassWithTraitAndInterface'
          3        SEND_VAL_EX                                              'foo'
          4        DO_FCALL                                      0  $0      
          5        ECHO                                                     $0
   19     6        NEW                                              $1      'ReflectionMethod'
          7        SEND_VAL_EX                                              'ClassWithTraitAndInterface'
          8        SEND_VAL_EX                                              'foo'
          9        DO_FCALL                                      0          
         10        INIT_METHOD_CALL                                         $1, 'getPrototype'
         11        DO_FCALL                                      0  $3      
         12        ECHO                                                     $3
         13      > RETURN                                                   1

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

End of function foo

End of class InterfaceWithMethod.

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

End of function foo

End of class SimpleTrait.

Class ClassWithTraitAndInterface: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.37 ms | 1394 KiB | 13 Q