Skip to content

Commit bc9a113

Browse files
committed
Add further ZPP conversions
1 parent 6f5ffc2 commit bc9a113

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

ext/date/php_date.c

+14-12
Original file line numberDiff line numberDiff line change
@@ -3352,9 +3352,9 @@ PHP_METHOD(DateTime, modify)
33523352
zend_error_handling zeh;
33533353

33543354
object = ZEND_THIS;
3355-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &modify, &modify_len) == FAILURE) {
3356-
RETURN_THROWS();
3357-
}
3355+
ZEND_PARSE_PARAMETERS_START(1, 1)
3356+
Z_PARAM_STRING(modify, modify_len)
3357+
ZEND_PARSE_PARAMETERS_END();
33583358

33593359
zend_replace_error_handling(EH_THROW, date_ce_date_malformed_string_exception, &zeh);
33603360
if (!php_date_modify(object, modify, modify_len)) {
@@ -3870,9 +3870,9 @@ PHP_METHOD(DateTimeImmutable, setMicrosecond)
38703870
php_date_obj *dateobj, *new_dateobj;
38713871
zend_long us;
38723872

3873-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &us) == FAILURE) {
3874-
RETURN_THROWS();
3875-
}
3873+
ZEND_PARSE_PARAMETERS_START(1, 1)
3874+
Z_PARAM_LONG(us)
3875+
ZEND_PARSE_PARAMETERS_END();
38763876

38773877
if (UNEXPECTED(us < 0 || us > 999999)) {
38783878
zend_argument_error(
@@ -3904,9 +3904,9 @@ PHP_METHOD(DateTime, setMicrosecond)
39043904
php_date_obj *dateobj;
39053905
zend_long us;
39063906

3907-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &us) == FAILURE) {
3908-
RETURN_THROWS();
3909-
}
3907+
ZEND_PARSE_PARAMETERS_START(1, 1)
3908+
Z_PARAM_LONG(us)
3909+
ZEND_PARSE_PARAMETERS_END();
39103910

39113911
if (UNEXPECTED(us < 0 || us > 999999)) {
39123912
zend_argument_error(
@@ -5126,9 +5126,11 @@ PHP_METHOD(DatePeriod, createFromISO8601String)
51265126
char *isostr = NULL;
51275127
size_t isostr_len = 0;
51285128

5129-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &isostr, &isostr_len, &options) == FAILURE) {
5130-
RETURN_THROWS();
5131-
}
5129+
ZEND_PARSE_PARAMETERS_START(1, 2)
5130+
Z_PARAM_STRING(isostr, isostr_len)
5131+
Z_PARAM_OPTIONAL
5132+
Z_PARAM_LONG(options)
5133+
ZEND_PARSE_PARAMETERS_END();
51325134

51335135
object_init_ex(return_value, execute_data->This.value.ce ? execute_data->This.value.ce : date_ce_period);
51345136
dpobj = Z_PHPPERIOD_P(return_value);

0 commit comments

Comments
 (0)