3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $timestamp = time(); echo $timestamp, PHP_EOL; $dateTime = new DateTime('@' . $timestamp); echo $dateTime->getTimestamp(), PHP_EOL, $dateTime->format('H:i:sP'), PHP_EOL; $dateTime = new DateTime('@' . $timestamp, new DateTimeZone()); echo $dateTime->getTimestamp(), PHP_EOL, $dateTime->format('H:i:sP'), PHP_EOL;
Output for 7.1.0 - 7.2.0
1452860414 1452860414 12:20:14+00:00 Fatal error: Uncaught ArgumentCountError: DateTimeZone::__construct() expects exactly 1 parameter, 0 given in /in/4GQGq:10 Stack trace: #0 /in/4GQGq(10): DateTimeZone->__construct() #1 {main} thrown in /in/4GQGq on line 10
Process exited with code 255.
Output for 7.0.0 - 7.0.20
1452860414 1452860414 12:20:14+00:00 Fatal error: Uncaught TypeError: DateTimeZone::__construct() expects exactly 1 parameter, 0 given in /in/4GQGq:10 Stack trace: #0 /in/4GQGq(10): DateTimeZone->__construct() #1 {main} thrown in /in/4GQGq on line 10
Process exited with code 255.
Output for 5.5.0 - 5.6.28
1452860414 1452860414 12:20:14+00:00 Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /in/4GQGq:10 Stack trace: #0 /in/4GQGq(10): DateTimeZone->__construct() #1 {main} thrown in /in/4GQGq on line 10
Process exited with code 255.