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.31, 7.4.0 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Formatter without pattern: ru Formatter with pattern: ru Formatter with pattern set later: ru
Output for 8.0.13
Fatal error: Uncaught Error: Class "IntlDateFormatter" not found in /in/S1CsZ:3 Stack trace: #0 {main} thrown in /in/S1CsZ on line 3
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.33
Fatal error: Uncaught Error: Class 'IntlDateFormatter' not found in /in/S1CsZ:3 Stack trace: #0 {main} thrown in /in/S1CsZ on line 3
Process exited with code 255.
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

preferences:
207.82 ms | 402 KiB | 253 Q