@@ -1236,6 +1236,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, z
12361236ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error (int num , const char * name , zval * arg );
12371237ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error (int num , const char * name , zval * arg );
12381238ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error (int num , char * error );
1239+ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_unexpected_extra_named_error (void );
1240+
12391241ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error (zend_class_entry * error_ce , uint32_t arg_num , const char * format , ...);
12401242ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_type_error (uint32_t arg_num , const char * format , ...);
12411243ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error (uint32_t arg_num , const char * format , ...);
@@ -1247,6 +1249,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error(uint32_t arg_num
12471249#define ZPP_ERROR_WRONG_CLASS_OR_NULL 4
12481250#define ZPP_ERROR_WRONG_ARG 5
12491251#define ZPP_ERROR_WRONG_COUNT 6
1252+ #define ZPP_ERROR_UNEXPECTED_EXTRA_NAMED 7
12501253
12511254#define ZEND_PARSE_PARAMETERS_START_EX (flags , min_num_args , max_num_args ) do { \
12521255 const int _flags = (flags); \
@@ -1301,6 +1304,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error(uint32_t arg_num
13011304 zend_wrong_parameter_class_or_null_error(_i, _error, _arg); \
13021305 } else if (_error_code == ZPP_ERROR_WRONG_ARG) { \
13031306 zend_wrong_parameter_type_error(_i, _expected_type, _arg); \
1307+ } else if (_error_code == ZPP_ERROR_UNEXPECTED_EXTRA_NAMED) { \
1308+ zend_unexpected_extra_named_error(); \
13041309 } \
13051310 } \
13061311 failure; \
@@ -1663,11 +1668,31 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error(uint32_t arg_num
16631668 dest = NULL; \
16641669 dest_num = 0; \
16651670 } \
1671+ if (UNEXPECTED(ZEND_CALL_INFO(execute_data) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { \
1672+ _error_code = ZPP_ERROR_UNEXPECTED_EXTRA_NAMED; \
1673+ break; \
1674+ } \
16661675 } while (0);
16671676
16681677#define Z_PARAM_VARIADIC (spec , dest , dest_num ) \
16691678 Z_PARAM_VARIADIC_EX(spec, dest, dest_num, 0)
16701679
1680+ #define Z_PARAM_VARIADIC_WITH_NAMED (spec , dest , dest_num , dest_named ) do { \
1681+ int _num_varargs = _num_args - _i; \
1682+ if (EXPECTED(_num_varargs > 0)) { \
1683+ dest = _real_arg + 1; \
1684+ dest_num = _num_varargs; \
1685+ } else { \
1686+ dest = NULL; \
1687+ dest_num = 0; \
1688+ } \
1689+ if (ZEND_CALL_INFO(execute_data) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { \
1690+ dest_named = execute_data->extra_named_params; \
1691+ } else { \
1692+ dest_named = NULL; \
1693+ } \
1694+ } while (0);
1695+
16711696#define Z_PARAM_STR_OR_ARRAY_HT_EX (dest_str , dest_ht , allow_null ) \
16721697 Z_PARAM_PROLOGUE(0, 0); \
16731698 if (UNEXPECTED(!zend_parse_arg_str_or_array_ht(_arg, &dest_str, &dest_ht, allow_null))) { \
0 commit comments