Closed
Description
Description
The following code:
<?php
$date = DateTimeImmutable::createFromFormat('Y-m-d', '2023-09-23', new DateTimeZone('Europe/London'));
foreach (['en', 'xx'] as $locale)
{
$formatter = new IntlDateFormatter(
$locale,
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
null,
null,
'w'
);
echo "Locale: $locale, Week number: " . $formatter->format($date) . "<br>\n";
}
Resulted in this output:
Locale: en, Week number: 38
Locale: xx, Week number: 39
But I expected this output instead:
Locale: en, Week number: 38
Locale: xx, Week number: 38
or else for an exception to be thrown when trying to use 'xx'.
This problem happens on all versions of PHP and all operating systems I have tested.
PHP Version
PHP 8.3.0RC2
Operating System
Windows NT 10.0 build 22621 (Windows 11) AMD64