3v4l.org

run code in 300+ PHP versions simultaneously
<?php $TZ= timezone_open( "UTC" ); $refdate=date_create_from_format ( "z Y" ,"31 2020" ,$TZ ); echo date_format($refdate,"d/m/Y"), PHP_EOL; $refdate=date_create_from_format ( "z Y" ,"60 2020" ,$TZ ); echo date_format($refdate,"d/m/Y"), PHP_EOL; $refdate=date_create_from_format ( "z Y" ,"91 2020" ,$TZ ); echo date_format($refdate,"d/m/Y"), PHP_EOL; $refdate=date_create_from_format ( "z Y" ,"121 2020" ,$TZ ); echo date_format($refdate,"d/m/Y"), PHP_EOL; $refdate=date_create_from_format ( "z Y" ,"130 2020" ,$TZ ); echo date_format($refdate,"d/m/Y"), PHP_EOL;
Output for 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
Fatal error: Uncaught TypeError: date_format(): Argument #1 ($object) must be of type DateTimeInterface, false given in /in/Drfk6:5 Stack trace: #0 /in/Drfk6(5): date_format(false, 'd/m/Y') #1 {main} thrown in /in/Drfk6 on line 5
Process exited with code 255.
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.0.10 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29
Fatal error: Uncaught TypeError: date_format(): Argument #1 ($object) must be of type DateTimeInterface, bool given in /in/Drfk6:5 Stack trace: #0 /in/Drfk6(5): date_format(false, 'd/m/Y') #1 {main} thrown in /in/Drfk6 on line 5
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.9
01/02/2020 02/03/2020 02/04/2020 02/05/2020 11/05/2020

preferences:
174.31 ms | 411 KiB | 5 Q