3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface I { } class B implements I { } class C extends B { function foo() {} } $rc = new \ReflectionClass('C'); $rm = $rc->getMethod('foo'); $drc = $rm->getDeclaringClass(); var_export($rc->getName() === $drc->getName());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oatRq
function name:  (null)
number of ops:  22
compiled vars:  !0 = $rc, !1 = $rm, !2 = $drc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'b'
   11     1        DECLARE_CLASS                                            'c', 'b'
   15     2        NEW                                              $3      'ReflectionClass'
          3        SEND_VAL_EX                                              'C'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $3
   16     6        INIT_METHOD_CALL                                         !0, 'getMethod'
          7        SEND_VAL_EX                                              'foo'
          8        DO_FCALL                                      0  $6      
          9        ASSIGN                                                   !1, $6
   17    10        INIT_METHOD_CALL                                         !1, 'getDeclaringClass'
         11        DO_FCALL                                      0  $8      
         12        ASSIGN                                                   !2, $8
   18    13        INIT_FCALL                                               'var_export'
         14        INIT_METHOD_CALL                                         !0, 'getName'
         15        DO_FCALL                                      0  $10     
         16        INIT_METHOD_CALL                                         !2, 'getName'
         17        DO_FCALL                                      0  $11     
         18        IS_IDENTICAL                                     ~12     $10, $11
         19        SEND_VAL                                                 ~12
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

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

End of function foo

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.69 ms | 1395 KiB | 15 Q