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.4, 8.3.6
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.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 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.0.10 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
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:
184.57 ms | 402 KiB | 180 Q