3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Moscow'); $d = \DateTime::createFromFormat('U', 0, 'EET'); var_dump($d);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Fatal error: Uncaught TypeError: DateTime::createFromFormat(): Argument #3 ($timezone) must be of type ?DateTimeZone, string given in /in/ruool:4 Stack trace: #0 /in/ruool(4): DateTime::createFromFormat('U', '0', 'EET') #1 {main} thrown in /in/ruool on line 4
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
Fatal error: Uncaught TypeError: Argument 3 passed to DateTime::createFromFormat() must be an instance of DateTimeZone or null, string given in /in/ruool:4 Stack trace: #0 /in/ruool(4): DateTime::createFromFormat('U', 0, 'EET') #1 {main} thrown in /in/ruool on line 4
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
Warning: DateTime::createFromFormat() expects parameter 3 to be DateTimeZone, string given in /in/ruool on line 4 bool(false)

preferences:
250.34 ms | 402 KiB | 331 Q