Merge branch 'PHP-7.1' into PHP-7.2

* PHP-7.1:
  Bugfix #74993 Wrong reflection param into for some intl: lookup_*() methods
This commit is contained in:
Sara Golemon 2017-07-26 18:56:06 -04:00
commit 08fef4cc23
3 changed files with 101 additions and 25 deletions

3
NEWS
View File

@ -14,6 +14,9 @@ PHP NEWS
. Fixed bug #74125 (Fixed finding CURL on systems with multiarch support).
(cebe)
- Intl:
. Fixed bug #74993 (Wrong reflection on some locale_* functions). (Sara)
- Mbstring:
. Fixed bug #69267 (mb_strtolower fails on titlecase characters). (Nikita)
. Fixed bug #71606 (Segmentation fault mb_strcut with HTML-ENTITIES encoding).

View File

@ -173,6 +173,24 @@ ZEND_BEGIN_ARG_INFO_EX(numfmt_parse_currency_arginfo, 0, 0, 3)
ZEND_ARG_INFO(1, position)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_get_loc_in_loc_args, 0, ZEND_RETURN_VALUE, 1 )
ZEND_ARG_INFO(0, locale)
ZEND_ARG_INFO(0, in_locale)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_filter_matches_args, 0, ZEND_RETURN_VALUE, 2 )
ZEND_ARG_INFO(0, langtag)
ZEND_ARG_INFO(0, locale)
ZEND_ARG_INFO(0, canonicalize)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_lookup_args, 0, ZEND_RETURN_VALUE, 2 )
ZEND_ARG_INFO(0, langtag)
ZEND_ARG_INFO(0, locale)
ZEND_ARG_INFO(0, canonicalize)
ZEND_ARG_INFO(0, def)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(locale_0_args, 0, 0, 0)
ZEND_END_ARG_INFO()
@ -180,24 +198,6 @@ ZEND_BEGIN_ARG_INFO_EX(locale_1_arg, 0, 0, 1)
ZEND_ARG_INFO(0, arg1)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(locale_2_args, 0, 0, 2)
ZEND_ARG_INFO(0, arg1)
ZEND_ARG_INFO(0, arg2)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(locale_3_args, 0, 0, 3)
ZEND_ARG_INFO(0, arg1)
ZEND_ARG_INFO(0, arg2)
ZEND_ARG_INFO(0, arg3)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(locale_4_args, 0, 0, 4)
ZEND_ARG_INFO(0, arg1)
ZEND_ARG_INFO(0, arg2)
ZEND_ARG_INFO(0, arg3)
ZEND_ARG_INFO(0, arg4)
ZEND_END_ARG_INFO()
#define intl_0_args collator_static_0_args
#define intl_1_arg collator_static_1_arg
@ -670,17 +670,17 @@ zend_function_entry intl_functions[] = {
PHP_FE( locale_get_script, locale_1_arg )
PHP_FE( locale_get_region, locale_1_arg )
PHP_FE( locale_get_keywords, locale_1_arg )
PHP_FE( locale_get_display_script, locale_2_args )
PHP_FE( locale_get_display_region, locale_2_args )
PHP_FE( locale_get_display_name, locale_2_args )
PHP_FE( locale_get_display_language, locale_2_args)
PHP_FE( locale_get_display_variant, locale_2_args )
PHP_FE( locale_get_display_script, locale_get_loc_in_loc_args )
PHP_FE( locale_get_display_region, locale_get_loc_in_loc_args )
PHP_FE( locale_get_display_name, locale_get_loc_in_loc_args )
PHP_FE( locale_get_display_language, locale_get_loc_in_loc_args)
PHP_FE( locale_get_display_variant, locale_get_loc_in_loc_args )
PHP_FE( locale_compose, locale_1_arg )
PHP_FE( locale_parse, locale_1_arg )
PHP_FE( locale_get_all_variants, locale_1_arg )
PHP_FE( locale_filter_matches, locale_3_args )
PHP_FE( locale_filter_matches, locale_filter_matches_args )
PHP_FE( locale_canonicalize, locale_1_arg )
PHP_FE( locale_lookup, locale_4_args )
PHP_FE( locale_lookup, locale_lookup_args )
PHP_FE( locale_accept_from_http, locale_1_arg )
/* MessageFormatter functions */

View File

@ -0,0 +1,73 @@
--TEST--
Bug #74993 Wrong reflection on some locale_* functions
--SKIPIF--
<?php
extension_loaded('intl') || print 'skip';
--FILE--
<?php
$funcs = [
'locale_get_display_language',
'locale_get_display_name',
'locale_get_display_region',
'locale_get_display_script',
'locale_get_display_variant',
'locale_filter_matches',
'locale_lookup',
];
foreach ($funcs as $func) {
echo (new ReflectionFunction($func));
}
--EXPECT--
Function [ <internal:intl> function locale_get_display_language ] {
- Parameters [2] {
Parameter #0 [ <required> $locale ]
Parameter #1 [ <optional> $in_locale ]
}
}
Function [ <internal:intl> function locale_get_display_name ] {
- Parameters [2] {
Parameter #0 [ <required> $locale ]
Parameter #1 [ <optional> $in_locale ]
}
}
Function [ <internal:intl> function locale_get_display_region ] {
- Parameters [2] {
Parameter #0 [ <required> $locale ]
Parameter #1 [ <optional> $in_locale ]
}
}
Function [ <internal:intl> function locale_get_display_script ] {
- Parameters [2] {
Parameter #0 [ <required> $locale ]
Parameter #1 [ <optional> $in_locale ]
}
}
Function [ <internal:intl> function locale_get_display_variant ] {
- Parameters [2] {
Parameter #0 [ <required> $locale ]
Parameter #1 [ <optional> $in_locale ]
}
}
Function [ <internal:intl> function locale_filter_matches ] {
- Parameters [3] {
Parameter #0 [ <required> $langtag ]
Parameter #1 [ <required> $locale ]
Parameter #2 [ <optional> $canonicalize ]
}
}
Function [ <internal:intl> function locale_lookup ] {
- Parameters [4] {
Parameter #0 [ <required> $langtag ]
Parameter #1 [ <required> $locale ]
Parameter #2 [ <optional> $canonicalize ]
Parameter #3 [ <optional> $def ]
}
}