3v4l.org

run code in 300+ PHP versions simultaneously
<?php function do_action_ref_array( $callback, $args ) { call_user_func_array( $callback, array_slice( $args, 0, 2 ) ); } $function = function( $arg1, &$arg2 ) { return $arg1; }; $args = [1, 2, 3]; do_action_ref_array( $function, $args );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qeUZt
function name:  (null)
number of ops:  8
compiled vars:  !0 = $function, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          1        ASSIGN                                                   !0, ~2
   11     2        ASSIGN                                                   !1, <array>
   13     3        INIT_FCALL                                               'do_action_ref_array'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qeUZt
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $arg1, !1 = $arg2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2      > RETURN                                                   !0
    9     3*     > RETURN                                                   null

End of Dynamic Function 0

Function do_action_ref_array:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qeUZt
function name:  do_action_ref_array
number of ops:  6
compiled vars:  !0 = $callback, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_USER_CALL                                0          'call_user_func_array', !0
          3        SEND_ARRAY                                               !1, 2
          4        DO_FCALL                                      0          
    5     5      > RETURN                                                   null

End of function do_action_ref_array

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.97 ms | 1452 KiB | 14 Q