3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function __call($name, $args) { switch ($name) { case 'bar': return 42; } } } $foo = new Foo(); var_dump(call_user_func([$foo, 'bar'])); $rc = new ReflectionClass(Foo::class); var_dump($rc->getMethods()); var_dump($rm = new ReflectionMethod($foo, 'bar'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jqXe6
function name:  (null)
number of ops:  28
compiled vars:  !0 = $foo, !1 = $rc, !2 = $rm
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $3      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   13     3        INIT_FCALL                                               'var_dump'
          4        INIT_ARRAY                                       ~6      !0
          5        ADD_ARRAY_ELEMENT                                ~6      'bar'
          6        INIT_USER_CALL                                0          'call_user_func', ~6
          7        DO_FCALL                                      0  $7      
          8        SEND_VAR                                                 $7
          9        DO_ICALL                                                 
   14    10        NEW                                              $9      'ReflectionClass'
         11        SEND_VAL_EX                                              'Foo'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !1, $9
   15    14        INIT_FCALL                                               'var_dump'
         15        INIT_METHOD_CALL                                         !1, 'getMethods'
         16        DO_FCALL                                      0  $12     
         17        SEND_VAR                                                 $12
         18        DO_ICALL                                                 
   16    19        INIT_FCALL                                               'var_dump'
         20        NEW                                              $14     'ReflectionMethod'
         21        SEND_VAR_EX                                              !0
         22        SEND_VAL_EX                                              'bar'
         23        DO_FCALL                                      0          
         24        ASSIGN                                           ~16     !2, $14
         25        SEND_VAL                                                 ~16
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Class Foo:
Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jqXe6
function name:  __call
number of ops:  7
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        IS_EQUAL                                                 !0, 'bar'
          3      > JMPNZ                                                    ~2, ->5
          4    > > JMP                                                      ->6
    7     5    > > RETURN                                                   42
    9     6    > > RETURN                                                   null

End of function __call

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.52 ms | 1396 KiB | 15 Q