3v4l.org

run code in 300+ PHP versions simultaneously
<?php $timezone = new DateTimeZone("Europe/Amsterdam"); $date = new DateTime("1940-01-01 00:00:00", $timezone); var_dump($date); $formatter = new IntlDateFormatter("en-US"); var_dump($formatter->format($date)); var_dump("INTL_ICU_VERSION: " . INTL_ICU_VERSION);
Output for 8.5.1
object(DateTime)#2 (3) { ["date"]=> string(26) "1940-01-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Fatal error: Uncaught Error: Class "IntlDateFormatter" not found in /in/UoVSs:7 Stack trace: #0 {main} thrown in /in/UoVSs on line 7
Process exited with code 255.
Output for 8.3.28, 8.4.16, 8.5.0
object(DateTime)#2 (3) { ["date"]=> string(26) "1940-01-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(46) "Sunday, December 31, 1939 at 11:40:00 PM GMT" string(22) "INTL_ICU_VERSION: 76.1"
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.1.28 - 8.1.33, 8.2.18 - 8.2.29, 8.3.5 - 8.3.27, 8.4.1 - 8.4.14
object(DateTime)#2 (3) { ["date"]=> string(26) "1940-01-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(48) "Monday, January 1, 1940 at 12:00:00 AM GMT+00:20" string(22) "INTL_ICU_VERSION: 63.1"
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
object(DateTime)#2 (3) { ["date"]=> string(26) "1940-01-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } string(48) "Monday, January 1, 1940 at 12:00:00 AM GMT+00:20" string(22) "INTL_ICU_VERSION: 57.1"
Output for 8.0.1 - 8.0.30
object(DateTime)#2 (3) { ["date"]=> string(26) "1940-01-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Fatal error: Uncaught ArgumentCountError: IntlDateFormatter::__construct() expects at least 3 arguments, 1 given in /in/UoVSs:7 Stack trace: #0 /in/UoVSs(7): IntlDateFormatter->__construct('en-US') #1 {main} thrown in /in/UoVSs on line 7
Process exited with code 255.

preferences:
126.57 ms | 414 KiB | 5 Q