3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface I { } class B implements I { } class C extends B { function foo() {} } $rx = new \ReflectionClass('X'); $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/qBUfg
function name:  (null)
number of ops:  26
compiled vars:  !0 = $rx, !1 = $rc, !2 = $rm, !3 = $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                                              $4      'ReflectionClass'
          3        SEND_VAL_EX                                              'X'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $4
   17     6        NEW                                              $7      'ReflectionClass'
          7        SEND_VAL_EX                                              'C'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
   18    10        INIT_METHOD_CALL                                         !1, 'getMethod'
         11        SEND_VAL_EX                                              'foo'
         12        DO_FCALL                                      0  $10     
         13        ASSIGN                                                   !2, $10
   19    14        INIT_METHOD_CALL                                         !2, 'getDeclaringClass'
         15        DO_FCALL                                      0  $12     
         16        ASSIGN                                                   !3, $12
   20    17        INIT_FCALL                                               'var_export'
         18        INIT_METHOD_CALL                                         !1, 'getName'
         19        DO_FCALL                                      0  $14     
         20        INIT_METHOD_CALL                                         !3, 'getName'
         21        DO_FCALL                                      0  $15     
         22        IS_IDENTICAL                                     ~16     $14, $15
         23        SEND_VAL                                                 ~16
         24        DO_ICALL                                                 
         25      > 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/qBUfg
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:
161.98 ms | 1396 KiB | 15 Q