@@ -1236,6 +1236,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, z
1236
1236
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error (int num , const char * name , zval * arg );
1237
1237
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error (int num , const char * name , zval * arg );
1238
1238
ZEND_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
+
1239
1241
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error (zend_class_entry * error_ce , uint32_t arg_num , const char * format , ...);
1240
1242
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_type_error (uint32_t arg_num , const char * format , ...);
1241
1243
ZEND_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
1247
1249
#define ZPP_ERROR_WRONG_CLASS_OR_NULL 4
1248
1250
#define ZPP_ERROR_WRONG_ARG 5
1249
1251
#define ZPP_ERROR_WRONG_COUNT 6
1252
+ #define ZPP_ERROR_UNEXPECTED_EXTRA_NAMED 7
1250
1253
1251
1254
#define ZEND_PARSE_PARAMETERS_START_EX (flags , min_num_args , max_num_args ) do { \
1252
1255
const int _flags = (flags); \
@@ -1301,6 +1304,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error(uint32_t arg_num
1301
1304
zend_wrong_parameter_class_or_null_error(_i, _error, _arg); \
1302
1305
} else if (_error_code == ZPP_ERROR_WRONG_ARG) { \
1303
1306
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(); \
1304
1309
} \
1305
1310
} \
1306
1311
failure; \
@@ -1663,11 +1668,31 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error(uint32_t arg_num
1663
1668
dest = NULL; \
1664
1669
dest_num = 0; \
1665
1670
} \
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
+ } \
1666
1675
} while (0);
1667
1676
1668
1677
#define Z_PARAM_VARIADIC (spec , dest , dest_num ) \
1669
1678
Z_PARAM_VARIADIC_EX(spec, dest, dest_num, 0)
1670
1679
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
+
1671
1696
#define Z_PARAM_STR_OR_ARRAY_HT_EX (dest_str , dest_ht , allow_null ) \
1672
1697
Z_PARAM_PROLOGUE(0, 0); \
1673
1698
if (UNEXPECTED(!zend_parse_arg_str_or_array_ht(_arg, &dest_str, &dest_ht, allow_null))) { \
0 commit comments