3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo($bar, $baz) { return [$bar, $baz]; } function userland_call_user_func(callable $function, ...$args) { return $function(...$args); } var_dump(userland_call_user_func('foo', 'bar', 'baz')); var_dump(call_user_func('foo', 'bar', 'baz'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HDQb6
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_FCALL                                                   'userland_call_user_func'
          2        SEND_VAL                                                     'foo'
          3        SEND_VAL                                                     'bar'
          4        SEND_VAL                                                     'baz'
          5        DO_FCALL                                          0  $0      
          6        SEND_VAR                                                     $0
          7        DO_ICALL                                                     
   10     8        INIT_FCALL                                                   'var_dump'
          9        INIT_FCALL                                                   'foo'
         10        SEND_USER                                                    'bar'
         11        SEND_USER                                                    'baz'
         12        DO_FCALL                                          0  $2      
         13        SEND_VAR                                                     $2
         14        DO_ICALL                                                     
         15      > RETURN                                                       1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HDQb6
function name:  foo
number of ops:  6
compiled vars:  !0 = $bar, !1 = $baz
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        INIT_ARRAY                                           ~2      !0
          3        ADD_ARRAY_ELEMENT                                    ~2      !1
          4      > RETURN                                                       ~2
          5*     > RETURN                                                       null

End of function foo

Function userland_call_user_func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HDQb6
function name:  userland_call_user_func
number of ops:  8
compiled vars:  !0 = $function, !1 = $args
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
          1        RECV_VARIADIC                                        !1      
          2        INIT_DYNAMIC_CALL                                            !0
          3        SEND_UNPACK                                                  !1
          4        CHECK_UNDEF_ARGS                                             
          5        DO_FCALL                                          1  $2      
          6      > RETURN                                                       $2
          7*     > RETURN                                                       null

End of function userland_call_user_func

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
237.43 ms | 2841 KiB | 16 Q