3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach (['en_US', 'ru_RU', 'es_ES', 'fa_IR'] as $locale) { $pattern = <<<CONFIG '%s' => [ 'medium_no_year-short' => "%s", // %s 'long_no_year-short' => "%s", // %s ], CONFIG; $mediumF = new IntlDateFormatter($locale, IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT); $longF = new IntlDateFormatter($locale, IntlDateFormatter::LONG, IntlDateFormatter::SHORT); printf( $pattern, $locale, $mediumF->getPattern(), $mediumF->format(1455111783), $longF->getPattern(), $longF->format(1455111783) ); }
Output for 8.1.28 - 8.1.30, 8.2.18 - 8.2.25, 8.3.5 - 8.3.13
'en_US' => [ 'medium_no_year-short' => "MMM d, y, h:mm a", // Feb 10, 2016, 2:43 PM 'long_no_year-short' => "MMMM d, y 'at' h:mm a", // February 10, 2016 at 2:43 PM ], 'ru_RU' => [ 'medium_no_year-short' => "d MMM y 'г'., HH:mm", // 10 февр. 2016 г., 14:43 'long_no_year-short' => "d MMMM y 'г'., HH:mm", // 10 февраля 2016 г., 14:43 ], 'es_ES' => [ 'medium_no_year-short' => "d MMM y H:mm", // 10 feb. 2016 14:43 'long_no_year-short' => "d 'de' MMMM 'de' y, H:mm", // 10 de febrero de 2016, 14:43 ], 'fa_IR' => [ 'medium_no_year-short' => "d MMM y،‏ H:mm", // ۱۰ فوریهٔ ۲۰۱۶،‏ ۱۴:۴۳ 'long_no_year-short' => "d MMMM y، ساعت H:mm", // ۱۰ فوریهٔ ۲۰۱۶، ساعت ۱۴:۴۳ ],
Output for 5.6.0 - 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 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.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
'en_US' => [ 'medium_no_year-short' => "MMM d, y, h:mm a", // Feb 10, 2016, 2:43 PM 'long_no_year-short' => "MMMM d, y 'at' h:mm a", // February 10, 2016 at 2:43 PM ], 'ru_RU' => [ 'medium_no_year-short' => "d MMM y 'г'., H:mm", // 10 февр. 2016 г., 14:43 'long_no_year-short' => "d MMMM y 'г'., H:mm", // 10 февраля 2016 г., 14:43 ], 'es_ES' => [ 'medium_no_year-short' => "d MMM y H:mm", // 10 feb. 2016 14:43 'long_no_year-short' => "d 'de' MMMM 'de' y, H:mm", // 10 de febrero de 2016, 14:43 ], 'fa_IR' => [ 'medium_no_year-short' => "d MMM y G،‏ H:mm", // ۱۰ فوریهٔ ۲۰۱۶ م.،‏ ۱۴:۴۳ 'long_no_year-short' => "d MMMM y G، ساعت H:mm", // ۱۰ فوریهٔ ۲۰۱۶ م.، ساعت ۱۴:۴۳ ],
Output for 8.0.13
Fatal error: Uncaught Error: Class "IntlDateFormatter" not found in /in/QQjmW:12 Stack trace: #0 {main} thrown in /in/QQjmW on line 12
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/QQjmW:12 Stack trace: #0 {main} thrown in /in/QQjmW on line 12
Process exited with code 255.
Output for 5.5.0 - 5.5.38
Fatal error: Class 'IntlDateFormatter' not found in /in/QQjmW on line 12
Process exited with code 255.

preferences:
92.86 ms | 412 KiB | 5 Q