3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); var_dump((new DateTime(null))->format('d-m-Y H:i'));
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.21, 8.3.0 - 8.3.9
Fatal error: Uncaught TypeError: DateTime::__construct(): Argument #1 ($datetime) must be of type string, null given in /in/53s19:3 Stack trace: #0 /in/53s19(3): DateTime->__construct(NULL) #1 {main} thrown in /in/53s19 on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 1 to be string, null given in /in/53s19:3 Stack trace: #0 /in/53s19(3): DateTime->__construct(NULL) #1 {main} thrown in /in/53s19 on line 3
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Warning: Unsupported declare 'strict_types' in /in/53s19 on line 2 string(16) "08-08-2017 20:00"

preferences:
242.07 ms | 403 KiB | 298 Q