3v4l.org

run code in 300+ PHP versions simultaneously
<?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;
Output for 7.0.6 - 7.0.20, 7.1.0 - 7.1.33, 7.2.6 - 7.2.33, 7.3.0 - 7.3.26, 7.4.0 - 7.4.14, 8.0.0
Formatter without pattern: ru Formatter with pattern: ru Formatter with pattern set later: ru
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.5
Formatter without pattern: ru Formatter with pattern: Formatter with pattern set later: ru