Skip to content

Commit ee153de

Browse files
committed
Change ZPP only if compiled with ICU >= 64
1 parent b01d9fd commit ee153de

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ext/intl/locale/locale_methods.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1554,11 +1554,17 @@ PHP_FUNCTION(locale_lookup)
15541554

15551555
intl_error_reset( NULL );
15561556

1557-
if(zend_parse_parameters( ZEND_NUM_ARGS(), "as|bS!", &arr, &loc_range, &loc_range_len,
1557+
#if U_ICU_VERSION_MAJOR_NUM > 63
1558+
# define BANG "!"
1559+
#else
1560+
# define BANG
1561+
#endif
1562+
if(zend_parse_parameters( ZEND_NUM_ARGS(), "as|bS" BANG, &arr, &loc_range, &loc_range_len,
15581563
&boolCanonical, &fallback_loc_str) == FAILURE) {
15591564
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_lookup: unable to parse input params", 0 );
15601565
RETURN_FALSE;
15611566
}
1567+
#undef BANG
15621568

15631569
if(loc_range_len == 0) {
15641570
if(fallback_loc_str) {

0 commit comments

Comments
 (0)