@@ -240,18 +240,12 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
240
240
size_t region_len = 0 ;
241
241
int32_t offset,
242
242
*offsetp = NULL ;
243
- int arg3isnull = 0 ;
244
- intl_error_reset (NULL );
243
+ zend_bool arg3isnull = 1 ;
245
244
246
- /* must come before zpp because zpp would convert the arg in the stack to 0 */
247
- if (ZEND_NUM_ARGS () == 3 ) {
248
- zval *dummy, *zvoffset;
249
- arg3isnull = zend_get_parameters_ex (3 , &dummy, &dummy, &zvoffset)
250
- != FAILURE && Z_TYPE_P (zvoffset) == IS_NULL;
251
- }
245
+ intl_error_reset (NULL );
252
246
253
- if (zend_parse_parameters (ZEND_NUM_ARGS (), " l|s!l" ,
254
- &zoneType, ®ion, ®ion_len, &offset_arg) == FAILURE) {
247
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), " l|s!l! " ,
248
+ &zoneType, ®ion, ®ion_len, &offset_arg, &arg3isnull ) == FAILURE) {
255
249
intl_error_set (NULL , U_ILLEGAL_ARGUMENT_ERROR,
256
250
" intltz_create_time_zone_id_enumeration: bad arguments" , 0 );
257
251
RETURN_FALSE;
@@ -264,18 +258,15 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
264
258
RETURN_FALSE;
265
259
}
266
260
267
- if (ZEND_NUM_ARGS () == 3 ) {
261
+ if (!arg3isnull ) {
268
262
if (offset_arg < (zend_long)INT32_MIN || offset_arg > (zend_long)INT32_MAX) {
269
263
intl_error_set (NULL , U_ILLEGAL_ARGUMENT_ERROR,
270
264
" intltz_create_time_zone_id_enumeration: offset out of bounds" , 0 );
271
265
RETURN_FALSE;
272
266
}
273
-
274
- if (!arg3isnull) {
275
- offset = (int32_t )offset_arg;
276
- offsetp = &offset;
277
- } // else leave offsetp NULL
278
- }
267
+ offset = (int32_t )offset_arg;
268
+ offsetp = &offset;
269
+ } // else leave offsetp NULL
279
270
280
271
StringEnumeration *se;
281
272
UErrorCode uec = UErrorCode ();
0 commit comments