3v4l.org

run code in 500+ PHP versions simultaneously
<?php class foo { static function bar($a) { echo $a; } } $r = new ReflectionClass('foo'); $m = $r->getMethod('bar'); $m->invoke('some_other_class_name', 'baz'); $m->invoke(42, 'baz'); $m->invoke(new DateTime, 'baz'); $m->invoke($r, 'baz');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8o4Hm
function name:  (null)
number of ops:  27
compiled vars:  !0 = $r, !1 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   NEW                                                  $2      'ReflectionClass'
          1        SEND_VAL_EX                                                  'foo'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $2
   12     4        INIT_METHOD_CALL                                             !0, 'getMethod'
          5        SEND_VAL_EX                                                  'bar'
          6        DO_FCALL                                          0  $5      
          7        ASSIGN                                                       !1, $5
   13     8        INIT_METHOD_CALL                                             !1, 'invoke'
          9        SEND_VAL_EX                                                  'some_other_class_name'
         10        SEND_VAL_EX                                                  'baz'
         11        DO_FCALL                                          0          
   14    12        INIT_METHOD_CALL                                             !1, 'invoke'
         13        SEND_VAL_EX                                                  42
         14        SEND_VAL_EX                                                  'baz'
         15        DO_FCALL                                          0          
   15    16        INIT_METHOD_CALL                                             !1, 'invoke'
         17        NEW                                                  $9      'DateTime'
         18        DO_FCALL                                          0          
         19        SEND_VAR_NO_REF_EX                                           $9
         20        SEND_VAL_EX                                                  'baz'
         21        DO_FCALL                                          0          
   16    22        INIT_METHOD_CALL                                             !1, 'invoke'
         23        SEND_VAR_EX                                                  !0
         24        SEND_VAL_EX                                                  'baz'
         25        DO_FCALL                                          0          
         26      > RETURN                                                       1

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

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
200.2 ms | 2166 KiB | 13 Q