3v4l.org

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

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

End of function bar

End of class Foo.

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

End of function bar

End of class Baz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.9 ms | 1396 KiB | 15 Q