Skip to content

Commit 506341b

Browse files
committed
Remove explicit uses of ZEND_PARSE_PARAMS_THROW
1 parent af7bb51 commit 506341b

File tree

11 files changed

+16
-23
lines changed

11 files changed

+16
-23
lines changed

Zend/zend_API.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ ZEND_API int zend_parse_parameters_throw(int num_args, const char *type_spec, ..
933933
{
934934
va_list va;
935935
int retval;
936-
int flags = ZEND_PARSE_PARAMS_THROW;
936+
int flags = 0;
937937

938938
va_start(va, type_spec);
939939
retval = zend_parse_va_args(num_args, type_spec, &va, flags);

ext/date/php_date.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2802,7 +2802,7 @@ PHP_METHOD(DateTime, __construct)
28022802
size_t time_str_len = 0;
28032803
zend_error_handling error_handling;
28042804

2805-
ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 0, 2)
2805+
ZEND_PARSE_PARAMETERS_START(0, 2)
28062806
Z_PARAM_OPTIONAL
28072807
Z_PARAM_STRING(time_str, time_str_len)
28082808
Z_PARAM_OBJECT_OF_CLASS_EX(timezone_object, date_ce_timezone, 1, 0)
@@ -2824,7 +2824,7 @@ PHP_METHOD(DateTimeImmutable, __construct)
28242824
size_t time_str_len = 0;
28252825
zend_error_handling error_handling;
28262826

2827-
ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 0, 2)
2827+
ZEND_PARSE_PARAMETERS_START(0, 2)
28282828
Z_PARAM_OPTIONAL
28292829
Z_PARAM_STRING(time_str, time_str_len)
28302830
Z_PARAM_OBJECT_OF_CLASS_EX(timezone_object, date_ce_timezone, 1, 0)
@@ -3829,7 +3829,7 @@ PHP_METHOD(DateTimeZone, __construct)
38293829
php_timezone_obj *tzobj;
38303830
zend_error_handling error_handling;
38313831

3832-
ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 1, 1)
3832+
ZEND_PARSE_PARAMETERS_START(1, 1)
38333833
Z_PARAM_STR(tz)
38343834
ZEND_PARSE_PARAMETERS_END();
38353835

@@ -4245,7 +4245,7 @@ PHP_METHOD(DateInterval, __construct)
42454245
timelib_rel_time *reltime;
42464246
zend_error_handling error_handling;
42474247

4248-
ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 1, 1)
4248+
ZEND_PARSE_PARAMETERS_START(1, 1)
42494249
Z_PARAM_STR(interval_string)
42504250
ZEND_PARSE_PARAMETERS_END();
42514251

ext/fileinfo/fileinfo.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,8 @@ PHP_FUNCTION(finfo_open)
292292
FILEINFO_DECLARE_INIT_OBJECT(object)
293293
char resolved_path[MAXPATHLEN];
294294
zend_error_handling zeh;
295-
int flags = object ? ZEND_PARSE_PARAMS_THROW : 0;
296295

297-
if (zend_parse_parameters_ex(flags, ZEND_NUM_ARGS(), "|lp", &options, &file, &file_len) == FAILURE) {
296+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lp", &options, &file, &file_len) == FAILURE) {
298297
RETURN_FALSE;
299298
}
300299

ext/intl/calendar/gregoriancalendar_methods.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ static void _php_intlgregcal_constructor_body(
5656
zend_long largs[6];
5757
UErrorCode status = U_ZERO_ERROR;
5858
int variant;
59-
int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0;
6059
intl_error_reset(NULL);
6160

6261
// parameter number validation / variant determination
@@ -86,7 +85,7 @@ static void _php_intlgregcal_constructor_body(
8685

8786
// argument parsing
8887
if (variant <= 2) {
89-
if (zend_parse_parameters_ex(zpp_flags, MIN(ZEND_NUM_ARGS(), 2),
88+
if (zend_parse_parameters(MIN(ZEND_NUM_ARGS(), 2),
9089
"|z!s!", &tz_object, &locale, &locale_len) == FAILURE) {
9190
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
9291
"intlgregcal_create_instance: bad arguments", 0);
@@ -97,7 +96,7 @@ static void _php_intlgregcal_constructor_body(
9796
return;
9897
}
9998
}
100-
if (variant > 2 && zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(),
99+
if (variant > 2 && zend_parse_parameters(ZEND_NUM_ARGS(),
101100
"lll|lll", &largs[0], &largs[1], &largs[2], &largs[3], &largs[4],
102101
&largs[5]) == FAILURE) {
103102
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,

ext/intl/collator/collator_create.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@ static int collator_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor)
3131
size_t locale_len = 0;
3232
zval* object;
3333
Collator_object* co;
34-
int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0;
3534

3635
intl_error_reset( NULL );
3736
object = return_value;
3837
/* Parse parameters. */
39-
if( zend_parse_parameters_ex( zpp_flags, ZEND_NUM_ARGS(), "s",
38+
if( zend_parse_parameters( ZEND_NUM_ARGS(), "s",
4039
&locale, &locale_len ) == FAILURE )
4140
{
4241
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,

ext/intl/dateformat/dateformat_create.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,11 @@ static int datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor)
6565
UChar* svalue = NULL; /* UTF-16 pattern_str */
6666
int32_t slength = 0;
6767
IntlDateFormatter_object* dfo;
68-
int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0;
6968

7069
intl_error_reset(NULL);
7170
object = return_value;
7271
/* Parse parameters. */
73-
if (zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(), "sll|zzs",
72+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll|zzs",
7473
&locale_str, &locale_len, &date_type, &time_type, &timezone_zv,
7574
&calendar_zv, &pattern_str, &pattern_str_len) == FAILURE) {
7675
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "

ext/intl/formatter/formatter_main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ static int numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor)
3333
zend_long style;
3434
UChar* spattern = NULL;
3535
int32_t spattern_len = 0;
36-
int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0;
3736
FORMATTER_METHOD_INIT_VARS;
3837

3938
/* Parse parameters. */
40-
if( zend_parse_parameters_ex( zpp_flags, ZEND_NUM_ARGS(), "sl|s",
39+
if( zend_parse_parameters( ZEND_NUM_ARGS(), "sl|s",
4140
&locale, &locale_len, &style, &pattern, &pattern_len ) == FAILURE )
4241
{
4342
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,

ext/intl/msgformat/msgformat.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,11 @@ static int msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor)
3636
int spattern_len = 0;
3737
zval* object;
3838
MessageFormatter_object* mfo;
39-
int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0;
4039
intl_error_reset( NULL );
4140

4241
object = return_value;
4342
/* Parse parameters. */
44-
if( zend_parse_parameters_ex( zpp_flags, ZEND_NUM_ARGS(), "ss",
43+
if( zend_parse_parameters( ZEND_NUM_ARGS(), "ss",
4544
&locale, &locale_len, &pattern, &pattern_len ) == FAILURE )
4645
{
4746
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,

ext/intl/resourcebundle/resourcebundle_class.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,13 @@ static int resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constr
8282
const char *locale;
8383
size_t locale_len = 0;
8484
zend_bool fallback = 1;
85-
int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0;
8685

8786
zval *object = return_value;
8887
ResourceBundle_object *rb = Z_INTL_RESOURCEBUNDLE_P( object );
8988

9089
intl_error_reset( NULL );
9190

92-
if( zend_parse_parameters_ex( zpp_flags, ZEND_NUM_ARGS(), "s!s!|b",
91+
if( zend_parse_parameters_ex( ZEND_NUM_ARGS(), "s!s!|b",
9392
&locale, &locale_len, &bundlename, &bundlename_len, &fallback ) == FAILURE )
9493
{
9594
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,

ext/pdo/pdo_dbh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ static PHP_METHOD(PDO, dbh_constructor)
209209
int call_factory = 1;
210210
zend_error_handling zeh;
211211

212-
ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 1, 4)
212+
ZEND_PARSE_PARAMETERS_START(1, 4)
213213
Z_PARAM_STRING(data_source, data_source_len)
214214
Z_PARAM_OPTIONAL
215215
Z_PARAM_STRING_EX(username, usernamelen, 1, 0)

0 commit comments

Comments
 (0)