3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { #[Test] public function foo() {} } class B extends A { public function foo() {} } var_dump((new ReflectionMethod('A', 'foo'))->getAttributes()); var_dump((new ReflectionMethod('B', 'foo'))->getAttributes());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GIZRj
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'ReflectionMethod'
          2        SEND_VAL_EX                                              'A'
          3        SEND_VAL_EX                                              'foo'
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $0, 'getAttributes'
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
   13     9        INIT_FCALL                                               'var_dump'
         10        NEW                                              $4      'ReflectionMethod'
         11        SEND_VAL_EX                                              'B'
         12        SEND_VAL_EX                                              'foo'
         13        DO_FCALL                                      0          
         14        INIT_METHOD_CALL                                         $4, 'getAttributes'
         15        DO_FCALL                                      0  $6      
         16        SEND_VAR                                                 $6
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

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

End of function foo

End of class A.

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

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.15 ms | 1002 KiB | 14 Q