3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($bar, $baz) { return [$bar, $baz]; } function userland_call_user_func_array(callable $function, array $args) { return $function(...$args); } var_dump(userland_call_user_func_array('foo', ['bar', 'baz'])); var_dump(call_user_func_array('foo', ['bar', 'baz']));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AgEG5
function name:  (null)
number of ops:  15
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_array'
          2        SEND_VAL                                                 'foo'
          3        SEND_VAL                                                 <array>
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
   10     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'foo'
          9        SEND_ARRAY                                               <array>
         10        CHECK_UNDEF_ARGS                                         
         11        DO_FCALL                                      0  $2      
         12        SEND_VAR                                                 $2
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AgEG5
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_array:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AgEG5
function name:  userland_call_user_func_array
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                                             !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_array

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.81 ms | 1399 KiB | 17 Q