Merge branch 'PHP-8.1' into PHP-8.2

This commit is contained in:
David Carlier 2023-11-01 19:13:08 +00:00
commit a39e869b55
3 changed files with 13 additions and 9 deletions

4
NEWS
View file

@ -24,6 +24,10 @@ PHP NEWS
. Fixed bug GH-12232 (FPM: segfault dynamically loading extension without
opcache). (Jakub Zelenka)
- Intl:
. Removed the BC break on IntlDateFormatter::construct which threw an
exception with an invalid locale. (David Carlier)
- Opcache:
. Added warning when JIT cannot be enabled. (danog)
. Fixed bug GH-8143 (Crashes in zend_accel_inheritance_cache_find since

View file

@ -113,8 +113,7 @@ static zend_result datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_error_handlin
locale = Locale::createFromName(locale_str);
/* get*Name accessors being set does not preclude being bogus */
if (locale.isBogus() || strlen(locale.getISO3Language()) == 0) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: invalid locale", 0);
return FAILURE;
goto error;
}
/* process calendar */

View file

@ -5,17 +5,18 @@ intl
--FILE--
<?php
try {
new IntlDateFormatter(
var_dump(new IntlDateFormatter(
'xx',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
null,
null,
'w'
);
} catch (\IntlException $e) {
echo $e->getMessage();
}
));
Locale::setDefault('xx');
var_dump(new IntlDateFormatter(Locale::getDefault()));
--EXPECT--
datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR
object(IntlDateFormatter)#1 (0) {
}
object(IntlDateFormatter)#1 (0) {
}