diff --git a/Zend/tests/named_params/call_user_func_array_variadic.phpt b/Zend/tests/named_params/call_user_func_array_variadic.phpt new file mode 100644 index 00000000000..89a8f7cb10e --- /dev/null +++ b/Zend/tests/named_params/call_user_func_array_variadic.phpt @@ -0,0 +1,13 @@ +--TEST-- +call_user_func_array() with extra named parameters +--FILE-- + 1); +call_user_func_array("array_multisort", $args); +?> +--EXPECTF-- +Fatal error: Uncaught ArgumentCountError: array_multisort() expects at least 1 argument, 0 given in %scall_user_func_array_variadic.php:3 +Stack trace: +#0 %scall_user_func_array_variadic.php(3): array_multisort(: 1) +#1 {main} + thrown in %scall_user_func_array_variadic.php on line 3 diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index ee983e675cd..e3e986e193c 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3987,6 +3987,7 @@ static void zend_compile_init_user_func(zend_ast *name_ast, uint32_t num_args, z static zend_result zend_compile_func_cufa(znode *result, zend_ast_list *args, zend_string *lcname) /* {{{ */ { znode arg_node; + zend_op *opline; if (args->children != 2) { return FAILURE; @@ -4028,7 +4029,8 @@ static zend_result zend_compile_func_cufa(znode *result, zend_ast_list *args, ze zend_compile_expr(&arg_node, args->child[1]); zend_emit_op(NULL, ZEND_SEND_ARRAY, &arg_node, NULL); zend_emit_op(NULL, ZEND_CHECK_UNDEF_ARGS, NULL, NULL); - zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL); + opline = zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL); + opline->extended_value = ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS; return SUCCESS; }