@@ -52,9 +52,9 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone)
52
52
size_t str_id_len;
53
53
intl_error_reset (NULL );
54
54
55
- if ( zend_parse_parameters ( ZEND_NUM_ARGS (), " s " , &str_id, &str_id_len) == FAILURE) {
56
- RETURN_THROWS ();
57
- }
55
+ ZEND_PARSE_PARAMETERS_START ( 1 , 1 )
56
+ Z_PARAM_STRING (str_id, str_id_len)
57
+ ZEND_PARSE_PARAMETERS_END ();
58
58
59
59
UErrorCode status = UErrorCode ();
60
60
UnicodeString id = UnicodeString ();
@@ -76,10 +76,9 @@ U_CFUNC PHP_FUNCTION(intltz_from_date_time_zone)
76
76
php_timezone_obj *tzobj;
77
77
intl_error_reset (NULL );
78
78
79
- if (zend_parse_parameters (ZEND_NUM_ARGS (), " O" ,
80
- &zv_timezone, php_date_get_timezone_ce ()) == FAILURE) {
81
- RETURN_THROWS ();
82
- }
79
+ ZEND_PARSE_PARAMETERS_START (1 , 1 )
80
+ Z_PARAM_OBJECT_OF_CLASS (zv_timezone, php_date_get_timezone_ce ())
81
+ ZEND_PARSE_PARAMETERS_END ();
83
82
84
83
tzobj = Z_PHPTIMEZONE_P (zv_timezone);
85
84
if (!tzobj->initialized ) {
@@ -102,9 +101,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_default)
102
101
{
103
102
intl_error_reset (NULL );
104
103
105
- if (zend_parse_parameters_none () == FAILURE) {
106
- return ;
107
- }
104
+ ZEND_PARSE_PARAMETERS_NONE ();
108
105
109
106
TimeZone *tz = TimeZone::createDefault ();
110
107
timezone_object_construct (tz, return_value, 1 );
@@ -114,9 +111,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_gmt)
114
111
{
115
112
intl_error_reset (NULL );
116
113
117
- if (zend_parse_parameters_none () == FAILURE) {
118
- RETURN_THROWS ();
119
- }
114
+ ZEND_PARSE_PARAMETERS_NONE ();
120
115
121
116
timezone_object_construct (TimeZone::getGMT (), return_value, 0 );
122
117
}
@@ -125,9 +120,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_unknown)
125
120
{
126
121
intl_error_reset (NULL );
127
122
128
- if (zend_parse_parameters_none () == FAILURE) {
129
- RETURN_THROWS ();
130
- }
123
+ ZEND_PARSE_PARAMETERS_NONE ();
131
124
132
125
timezone_object_construct (&TimeZone::getUnknown (), return_value, 0 );
133
126
}
@@ -140,9 +133,10 @@ U_CFUNC PHP_FUNCTION(intltz_create_enumeration)
140
133
141
134
/* double indirection to have the zend engine destroy the new zval that
142
135
* results from separation */
143
- if (zend_parse_parameters (ZEND_NUM_ARGS (), " |z" , &arg) == FAILURE) {
144
- RETURN_THROWS ();
145
- }
136
+ ZEND_PARSE_PARAMETERS_START (0 , 1 )
137
+ Z_PARAM_OPTIONAL
138
+ Z_PARAM_ZVAL (arg)
139
+ ZEND_PARSE_PARAMETERS_END ();
146
140
147
141
if (arg == NULL || Z_TYPE_P (arg) == IS_NULL) {
148
142
se = TimeZone::createEnumeration ();
@@ -199,10 +193,9 @@ U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids)
199
193
size_t str_id_len;
200
194
intl_error_reset (NULL );
201
195
202
- if (zend_parse_parameters (ZEND_NUM_ARGS (), " s" ,
203
- &str_id, &str_id_len) == FAILURE) {
204
- RETURN_THROWS ();
205
- }
196
+ ZEND_PARSE_PARAMETERS_START (1 , 1 )
197
+ Z_PARAM_STRING (str_id, str_id_len)
198
+ ZEND_PARSE_PARAMETERS_END ();
206
199
207
200
UErrorCode status = UErrorCode ();
208
201
UnicodeString id = UnicodeString ();
@@ -221,17 +214,19 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
221
214
zend_long zoneType,
222
215
offset_arg;
223
216
char *region = NULL ;
224
- size_t region_len = 0 ;
217
+ size_t region_len = 0 ;
225
218
int32_t offset,
226
219
*offsetp = NULL ;
227
220
bool arg3isnull = 1 ;
228
221
229
222
intl_error_reset (NULL );
230
223
231
- if (zend_parse_parameters (ZEND_NUM_ARGS (), " l|s!l!" ,
232
- &zoneType, ®ion, ®ion_len, &offset_arg, &arg3isnull) == FAILURE) {
233
- RETURN_THROWS ();
234
- }
224
+ ZEND_PARSE_PARAMETERS_START (1 , 3 )
225
+ Z_PARAM_LONG (zoneType)
226
+ Z_PARAM_OPTIONAL
227
+ Z_PARAM_STRING_OR_NULL (region, region_len)
228
+ Z_PARAM_LONG_OR_NULL (offset_arg, arg3isnull)
229
+ ZEND_PARSE_PARAMETERS_END ();
235
230
236
231
if (zoneType != UCAL_ZONE_TYPE_ANY && zoneType != UCAL_ZONE_TYPE_CANONICAL
237
232
&& zoneType != UCAL_ZONE_TYPE_CANONICAL_LOCATION) {
@@ -266,10 +261,11 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id)
266
261
zval *is_systemid = NULL ;
267
262
intl_error_reset (NULL );
268
263
269
- if (zend_parse_parameters (ZEND_NUM_ARGS (), " s|z" ,
270
- &str_id, &str_id_len, &is_systemid) == FAILURE) {
271
- RETURN_THROWS ();
272
- }
264
+ ZEND_PARSE_PARAMETERS_START (1 , 2 )
265
+ Z_PARAM_STRING (str_id, str_id_len)
266
+ Z_PARAM_OPTIONAL
267
+ Z_PARAM_ZVAL (is_systemid)
268
+ ZEND_PARSE_PARAMETERS_END ();
273
269
274
270
UErrorCode status = UErrorCode ();
275
271
UnicodeString id;
@@ -303,10 +299,9 @@ U_CFUNC PHP_FUNCTION(intltz_get_region)
303
299
char outbuf[3 ];
304
300
intl_error_reset (NULL );
305
301
306
- if (zend_parse_parameters (ZEND_NUM_ARGS (), " s" ,
307
- &str_id, &str_id_len) == FAILURE) {
308
- RETURN_THROWS ();
309
- }
302
+ ZEND_PARSE_PARAMETERS_START (1 , 1 )
303
+ Z_PARAM_STRING (str_id, str_id_len)
304
+ ZEND_PARSE_PARAMETERS_END ();
310
305
311
306
UErrorCode status = UErrorCode ();
312
307
UnicodeString id;
@@ -326,9 +321,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_tz_data_version)
326
321
{
327
322
intl_error_reset (NULL );
328
323
329
- if (zend_parse_parameters_none () == FAILURE) {
330
- RETURN_THROWS ();
331
- }
324
+ ZEND_PARSE_PARAMETERS_NONE ();
332
325
333
326
UErrorCode status = UErrorCode ();
334
327
const char *res = TimeZone::getTZDataVersion (status);
@@ -344,9 +337,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id)
344
337
zend_long index;
345
338
intl_error_reset (NULL );
346
339
347
- if (zend_parse_parameters (ZEND_NUM_ARGS (), " sl" , &str_id, &str_id_len, &index) == FAILURE) {
348
- RETURN_THROWS ();
349
- }
340
+ ZEND_PARSE_PARAMETERS_START (2 , 2 )
341
+ Z_PARAM_STRING (str_id, str_id_len)
342
+ Z_PARAM_LONG (index)
343
+ ZEND_PARSE_PARAMETERS_END ();
350
344
351
345
if (UNEXPECTED (index < (zend_long)INT32_MIN || index > (zend_long)INT32_MAX)) {
352
346
RETURN_FALSE;
@@ -375,10 +369,9 @@ U_CFUNC PHP_FUNCTION(intltz_get_iana_id)
375
369
size_t str_id_len;
376
370
intl_error_reset (NULL );
377
371
378
- if (zend_parse_parameters (ZEND_NUM_ARGS (), " s" ,
379
- &str_id, &str_id_len) == FAILURE) {
380
- RETURN_THROWS ();
381
- }
372
+ ZEND_PARSE_PARAMETERS_START (1 , 1 )
373
+ Z_PARAM_STRING (str_id, str_id_len)
374
+ ZEND_PARSE_PARAMETERS_END ();
382
375
383
376
UErrorCode status = UErrorCode ();
384
377
UnicodeString id;
@@ -635,9 +628,9 @@ U_CFUNC PHP_FUNCTION(intltz_get_windows_id)
635
628
UnicodeString uID, uWinID;
636
629
UErrorCode error;
637
630
638
- if ( zend_parse_parameters ( ZEND_NUM_ARGS (), " S " , &id) == FAILURE) {
639
- RETURN_THROWS ();
640
- }
631
+ ZEND_PARSE_PARAMETERS_START ( 1 , 1 )
632
+ Z_PARAM_STR (id)
633
+ ZEND_PARSE_PARAMETERS_END ();
641
634
642
635
error = U_ZERO_ERROR;
643
636
if (intl_stringFromChar (uID, id->val , id->len , &error) == FAILURE) {
@@ -671,9 +664,11 @@ U_CFUNC PHP_FUNCTION(intltz_get_id_for_windows_id)
671
664
UnicodeString uWinID, uID;
672
665
UErrorCode error;
673
666
674
- if (zend_parse_parameters (ZEND_NUM_ARGS (), " S|S!" , &winID, ®ion) == FAILURE) {
675
- RETURN_THROWS ();
676
- }
667
+ ZEND_PARSE_PARAMETERS_START (1 , 2 )
668
+ Z_PARAM_STR (winID)
669
+ Z_PARAM_OPTIONAL
670
+ Z_PARAM_STR_OR_NULL (region)
671
+ ZEND_PARSE_PARAMETERS_END ();
677
672
678
673
error = U_ZERO_ERROR;
679
674
if (intl_stringFromChar (uWinID, winID->val , winID->len , &error) == FAILURE) {
0 commit comments