@@ -1240,6 +1240,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error(i
1240
1240
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_string_or_class_error (int num , const char * name , zval * arg );
1241
1241
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_string_or_class_or_null_error (int num , const char * name , zval * arg );
1242
1242
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error (int num , char * error );
1243
+ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_unexpected_extra_named_error (void );
1244
+
1243
1245
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error (zend_class_entry * error_ce , uint32_t arg_num , const char * format , ...);
1244
1246
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_type_error (uint32_t arg_num , const char * format , ...);
1245
1247
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error (uint32_t arg_num , const char * format , ...);
@@ -1253,6 +1255,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error(uint32_t arg_num
1253
1255
#define ZPP_ERROR_WRONG_COUNT 6
1254
1256
#define ZPP_ERROR_WRONG_STRING_OR_CLASS 7
1255
1257
#define ZPP_ERROR_WRONG_STRING_OR_CLASS_OR_NULL 8
1258
+ #define ZPP_ERROR_UNEXPECTED_EXTRA_NAMED 9
1256
1259
1257
1260
#define ZEND_PARSE_PARAMETERS_START_EX (flags , min_num_args , max_num_args ) do { \
1258
1261
const int _flags = (flags); \
@@ -1311,6 +1314,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error(uint32_t arg_num
1311
1314
zend_wrong_parameter_string_or_class_error(_i, _error, _arg); \
1312
1315
} else if (_error_code == ZPP_ERROR_WRONG_STRING_OR_CLASS_OR_NULL) { \
1313
1316
zend_wrong_parameter_string_or_class_or_null_error(_i, _error, _arg); \
1317
+ } else if (_error_code == ZPP_ERROR_UNEXPECTED_EXTRA_NAMED) { \
1318
+ zend_unexpected_extra_named_error(); \
1314
1319
} \
1315
1320
} \
1316
1321
failure; \
@@ -1707,11 +1712,31 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error(uint32_t arg_num
1707
1712
dest = NULL; \
1708
1713
dest_num = 0; \
1709
1714
} \
1715
+ if (UNEXPECTED(ZEND_CALL_INFO(execute_data) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { \
1716
+ _error_code = ZPP_ERROR_UNEXPECTED_EXTRA_NAMED; \
1717
+ break; \
1718
+ } \
1710
1719
} while (0);
1711
1720
1712
1721
#define Z_PARAM_VARIADIC (spec , dest , dest_num ) \
1713
1722
Z_PARAM_VARIADIC_EX(spec, dest, dest_num, 0)
1714
1723
1724
+ #define Z_PARAM_VARIADIC_WITH_NAMED (spec , dest , dest_num , dest_named ) do { \
1725
+ int _num_varargs = _num_args - _i; \
1726
+ if (EXPECTED(_num_varargs > 0)) { \
1727
+ dest = _real_arg + 1; \
1728
+ dest_num = _num_varargs; \
1729
+ } else { \
1730
+ dest = NULL; \
1731
+ dest_num = 0; \
1732
+ } \
1733
+ if (ZEND_CALL_INFO(execute_data) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { \
1734
+ dest_named = execute_data->extra_named_params; \
1735
+ } else { \
1736
+ dest_named = NULL; \
1737
+ } \
1738
+ } while (0);
1739
+
1715
1740
#define Z_PARAM_STR_OR_ARRAY_HT_EX (dest_str , dest_ht , allow_null ) \
1716
1741
Z_PARAM_PROLOGUE(0, 0); \
1717
1742
if (UNEXPECTED(!zend_parse_arg_str_or_array_ht(_arg, &dest_str, &dest_ht, allow_null))) { \
0 commit comments