Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 78d7ad2

Browse filesBrowse files
committed
eliminate usage of deprecated zend_get_parameters_ex
1 parent b946621 commit 78d7ad2
Copy full SHA for 78d7ad2

File tree

Expand file treeCollapse file tree

1 file changed

+8
-17
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-17
lines changed

‎ext/intl/timezone/timezone_methods.cpp

Copy file name to clipboardExpand all lines: ext/intl/timezone/timezone_methods.cpp
+8-17Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -240,18 +240,12 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
240240
size_t region_len = 0;
241241
int32_t offset,
242242
*offsetp = NULL;
243-
int arg3isnull = 0;
244-
intl_error_reset(NULL);
243+
zend_bool arg3isnull = 1;
245244

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);
252246

253-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s!l",
254-
&zoneType, &region, &region_len, &offset_arg) == FAILURE) {
247+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s!l!",
248+
&zoneType, &region, &region_len, &offset_arg, &arg3isnull) == FAILURE) {
255249
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
256250
"intltz_create_time_zone_id_enumeration: bad arguments", 0);
257251
RETURN_FALSE;
@@ -264,18 +258,15 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
264258
RETURN_FALSE;
265259
}
266260

267-
if (ZEND_NUM_ARGS() == 3) {
261+
if (!arg3isnull) {
268262
if (offset_arg < (zend_long)INT32_MIN || offset_arg > (zend_long)INT32_MAX) {
269263
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
270264
"intltz_create_time_zone_id_enumeration: offset out of bounds", 0);
271265
RETURN_FALSE;
272266
}
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
279270

280271
StringEnumeration *se;
281272
UErrorCode uec = UErrorCode();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.