@@ -3352,9 +3352,9 @@ PHP_METHOD(DateTime, modify)
3352
3352
zend_error_handling zeh ;
3353
3353
3354
3354
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 ();
3358
3358
3359
3359
zend_replace_error_handling (EH_THROW , date_ce_date_malformed_string_exception , & zeh );
3360
3360
if (!php_date_modify (object , modify , modify_len )) {
@@ -3377,9 +3377,9 @@ PHP_METHOD(DateTimeImmutable, modify)
3377
3377
zend_error_handling zeh ;
3378
3378
3379
3379
object = ZEND_THIS ;
3380
- if ( zend_parse_parameters ( ZEND_NUM_ARGS (), "s" , & modify , & modify_len ) == FAILURE ) {
3381
- RETURN_THROWS ();
3382
- }
3380
+ ZEND_PARSE_PARAMETERS_START ( 1 , 1 )
3381
+ Z_PARAM_STRING ( modify , modify_len )
3382
+ ZEND_PARSE_PARAMETERS_END ();
3383
3383
3384
3384
date_clone_immutable (object , & new_object );
3385
3385
@@ -3437,9 +3437,9 @@ PHP_METHOD(DateTimeImmutable, add)
3437
3437
zval * object , * interval , new_object ;
3438
3438
3439
3439
object = ZEND_THIS ;
3440
- if ( zend_parse_parameters ( ZEND_NUM_ARGS (), "O" , & interval , date_ce_interval ) == FAILURE ) {
3441
- RETURN_THROWS ();
3442
- }
3440
+ ZEND_PARSE_PARAMETERS_START ( 1 , 1 )
3441
+ Z_PARAM_OBJECT_OF_CLASS ( interval , date_ce_interval )
3442
+ ZEND_PARSE_PARAMETERS_END ();
3443
3443
3444
3444
date_clone_immutable (object , & new_object );
3445
3445
php_date_add (& new_object , interval , return_value );
@@ -3512,9 +3512,9 @@ PHP_METHOD(DateTimeImmutable, sub)
3512
3512
zend_error_handling zeh ;
3513
3513
3514
3514
object = ZEND_THIS ;
3515
- if ( zend_parse_parameters ( ZEND_NUM_ARGS (), "O" , & interval , date_ce_interval ) == FAILURE ) {
3516
- RETURN_THROWS ();
3517
- }
3515
+ ZEND_PARSE_PARAMETERS_START ( 1 , 1 )
3516
+ Z_PARAM_OBJECT_OF_CLASS ( interval , date_ce_interval )
3517
+ ZEND_PARSE_PARAMETERS_END ();
3518
3518
3519
3519
date_clone_immutable (object , & new_object );
3520
3520
@@ -3621,9 +3621,9 @@ PHP_METHOD(DateTimeImmutable, setTimezone)
3621
3621
zval * timezone_object ;
3622
3622
3623
3623
object = ZEND_THIS ;
3624
- if ( zend_parse_parameters ( ZEND_NUM_ARGS (), "O" , & timezone_object , date_ce_timezone ) == FAILURE ) {
3625
- RETURN_THROWS ();
3626
- }
3624
+ ZEND_PARSE_PARAMETERS_START ( 1 , 1 )
3625
+ Z_PARAM_OBJECT_OF_CLASS ( timezone_object , date_ce_timezone )
3626
+ ZEND_PARSE_PARAMETERS_END ();
3627
3627
3628
3628
date_clone_immutable (object , & new_object );
3629
3629
php_date_timezone_set (& new_object , timezone_object , return_value );
@@ -3702,9 +3702,13 @@ PHP_METHOD(DateTimeImmutable, setTime)
3702
3702
zend_long h , i , s = 0 , ms = 0 ;
3703
3703
3704
3704
object = ZEND_THIS ;
3705
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "ll|ll" , & h , & i , & s , & ms ) == FAILURE ) {
3706
- RETURN_THROWS ();
3707
- }
3705
+ ZEND_PARSE_PARAMETERS_START (2 , 4 )
3706
+ Z_PARAM_LONG (h )
3707
+ Z_PARAM_LONG (i )
3708
+ Z_PARAM_OPTIONAL
3709
+ Z_PARAM_LONG (s )
3710
+ Z_PARAM_LONG (ms )
3711
+ ZEND_PARSE_PARAMETERS_END ();
3708
3712
3709
3713
date_clone_immutable (object , & new_object );
3710
3714
php_date_time_set (& new_object , h , i , s , ms , return_value );
@@ -3748,9 +3752,11 @@ PHP_METHOD(DateTimeImmutable, setDate)
3748
3752
zend_long y , m , d ;
3749
3753
3750
3754
object = ZEND_THIS ;
3751
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "lll" , & y , & m , & d ) == FAILURE ) {
3752
- RETURN_THROWS ();
3753
- }
3755
+ ZEND_PARSE_PARAMETERS_START (3 , 3 )
3756
+ Z_PARAM_LONG (y )
3757
+ Z_PARAM_LONG (m )
3758
+ Z_PARAM_LONG (d )
3759
+ ZEND_PARSE_PARAMETERS_END ();
3754
3760
3755
3761
date_clone_immutable (object , & new_object );
3756
3762
php_date_date_set (& new_object , y , m , d , return_value );
@@ -3798,9 +3804,12 @@ PHP_METHOD(DateTimeImmutable, setISODate)
3798
3804
zend_long y , w , d = 1 ;
3799
3805
3800
3806
object = ZEND_THIS ;
3801
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "ll|l" , & y , & w , & d ) == FAILURE ) {
3802
- RETURN_THROWS ();
3803
- }
3807
+ ZEND_PARSE_PARAMETERS_START (2 , 3 )
3808
+ Z_PARAM_LONG (y )
3809
+ Z_PARAM_LONG (w )
3810
+ Z_PARAM_OPTIONAL
3811
+ Z_PARAM_LONG (d )
3812
+ ZEND_PARSE_PARAMETERS_END ();
3804
3813
3805
3814
date_clone_immutable (object , & new_object );
3806
3815
php_date_isodate_set (& new_object , y , w , d , return_value );
@@ -3843,9 +3852,9 @@ PHP_METHOD(DateTimeImmutable, setTimestamp)
3843
3852
zend_long timestamp ;
3844
3853
3845
3854
object = ZEND_THIS ;
3846
- if ( zend_parse_parameters ( ZEND_NUM_ARGS (), "l" , & timestamp ) == FAILURE ) {
3847
- RETURN_THROWS ();
3848
- }
3855
+ ZEND_PARSE_PARAMETERS_START ( 1 , 1 )
3856
+ Z_PARAM_LONG ( timestamp )
3857
+ ZEND_PARSE_PARAMETERS_END ();
3849
3858
3850
3859
date_clone_immutable (object , & new_object );
3851
3860
php_date_timestamp_set (& new_object , timestamp , return_value );
@@ -3861,9 +3870,9 @@ PHP_METHOD(DateTimeImmutable, setMicrosecond)
3861
3870
php_date_obj * dateobj , * new_dateobj ;
3862
3871
zend_long us ;
3863
3872
3864
- if ( zend_parse_parameters ( ZEND_NUM_ARGS (), "l" , & us ) == FAILURE ) {
3865
- RETURN_THROWS ();
3866
- }
3873
+ ZEND_PARSE_PARAMETERS_START ( 1 , 1 )
3874
+ Z_PARAM_LONG ( us )
3875
+ ZEND_PARSE_PARAMETERS_END ();
3867
3876
3868
3877
if (UNEXPECTED (us < 0 || us > 999999 )) {
3869
3878
zend_argument_error (
@@ -3895,9 +3904,9 @@ PHP_METHOD(DateTime, setMicrosecond)
3895
3904
php_date_obj * dateobj ;
3896
3905
zend_long us ;
3897
3906
3898
- if ( zend_parse_parameters ( ZEND_NUM_ARGS (), "l" , & us ) == FAILURE ) {
3899
- RETURN_THROWS ();
3900
- }
3907
+ ZEND_PARSE_PARAMETERS_START ( 1 , 1 )
3908
+ Z_PARAM_LONG ( us )
3909
+ ZEND_PARSE_PARAMETERS_END ();
3901
3910
3902
3911
if (UNEXPECTED (us < 0 || us > 999999 )) {
3903
3912
zend_argument_error (
@@ -5117,9 +5126,11 @@ PHP_METHOD(DatePeriod, createFromISO8601String)
5117
5126
char * isostr = NULL ;
5118
5127
size_t isostr_len = 0 ;
5119
5128
5120
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "s|l" , & isostr , & isostr_len , & options ) == FAILURE ) {
5121
- RETURN_THROWS ();
5122
- }
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 ();
5123
5134
5124
5135
object_init_ex (return_value , execute_data -> This .value .ce ? execute_data -> This .value .ce : date_ce_period );
5125
5136
dpobj = Z_PHPPERIOD_P (return_value );
0 commit comments