3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); var_dump((new DateTime(null))->format('d-m-Y H:i'));
based on cOvhd
Output for 7.0.0 - 7.3.1
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 hhvm-3.15.4 - 3.21.0
Fatal error: Uncaught TypeError: Argument 1 passed to DateTime::__construct() must be an instance of string, null given in /in/53s19:3 Stack trace: #0 /in/53s19(3): DateTime->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Warning: Unsupported declare 'strict_types' in /in/53s19 on line 2 string(16) "08-08-2017 20:00"