3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Get Localized month name * @param int $month * @param string $locale * @param string $format * @return string */ function getLocalizedMonthName($month, $locale, $format = "LLLL") { $dateFormatter = new IntlDateFormatter($locale, IntlDateFormatter::FULL, IntlDateFormatter::FULL); $dateFormatter->setPattern($format); return $dateFormatter->format(mktime(0, 0, 0, $month)); } $locales = ['pl_PL', 'en-US']; foreach ($locales as $locale) { foreach (range(1, 12) as $monthNumber) { echo $monthNumber . " - " . getLocalizedMonthName($monthNumber, $locale) . PHP_EOL; } echo PHP_EOL . PHP_EOL; }
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 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.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
1 - styczeń 2 - luty 3 - marzec 4 - kwiecień 5 - maj 6 - czerwiec 7 - lipiec 8 - sierpień 9 - wrzesień 10 - październik 11 - listopad 12 - grudzień 1 - January 2 - February 3 - March 4 - April 5 - May 6 - June 7 - July 8 - August 9 - September 10 - October 11 - November 12 - December
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 1 - styczeń 2 - luty 3 - marzec 4 - kwiecień 5 - maj 6 - czerwiec 7 - lipiec 8 - sierpień 9 - wrzesień 10 - październik 11 - listopad 12 - grudzień 1 - January 2 - February 3 - March 4 - April 5 - May 6 - June 7 - July 8 - August 9 - September 10 - October 11 - November 12 - December
Output for 8.0.13
Fatal error: Uncaught Error: Class "IntlDateFormatter" not found in /in/bSRkm:11 Stack trace: #0 /in/bSRkm(20): getLocalizedMonthName(1, 'pl_PL') #1 {main} thrown in /in/bSRkm on line 11
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/bSRkm:11 Stack trace: #0 /in/bSRkm(20): getLocalizedMonthName(1, 'pl_PL') #1 {main} thrown in /in/bSRkm on line 11
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Fatal error: Class 'IntlDateFormatter' not found in /in/bSRkm on line 11
Process exited with code 255.

preferences:
266.66 ms | 401 KiB | 376 Q