|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-04-08 07:01 UTC] ab@php.net
[2016-04-08 07:01 UTC] ab@php.net
-Status: Open
+Status: Closed
[2016-07-20 11:32 UTC] davey@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 15:00:02 2025 UTC |
Description: ------------ When IntlDateFormatter is created with pattern, getLocale always return empty string. If pattern is not set or set via setPattern - all is OK. Test script: --------------- <?php $goodFormatter = new IntlDateFormatter("ru_RU", IntlDateFormatter::FULL, IntlDateFormatter::FULL, new DateTimeZone("UTC")); $badFormatter = new IntlDateFormatter("ru_RU", IntlDateFormatter::FULL, IntlDateFormatter::FULL, new DateTimeZone("UTC"), null, "d MMM"); $badFormatter2 = new IntlDateFormatter("ru_RU", IntlDateFormatter::FULL, IntlDateFormatter::FULL, new DateTimeZone("UTC")); $badFormatter2->setPattern("d MMM"); echo "Formatter without pattern: " . $goodFormatter->getLocale() . PHP_EOL; echo "Formatter with pattern: " . $badFormatter->getLocale() . PHP_EOL; echo "Formatter with pattern set later: " . $badFormatter2->getLocale() . PHP_EOL; Expected result: ---------------- getLocale() always must return original locale. Actual result: -------------- Proof - https://3v4l.org/S1CsZ