3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "datetime: " . date('Y-m-d H:i:s') . "\n"; echo "time: " . time() . "\n"; $date = DateTime::createFromFormat('Y-m-d H:i:s', '2016-01-07 22:28:34'); echo "datetime with offset: " . date('Y-m-d H:i:s', $date->format('U') + 32400) . "\n"; echo "date now: " . date('Y-m-d H:i:s')->format(\DateTime::RFC2822);;
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.13, 7.3.0 - 7.3.1
datetime: 2016-01-07 22:32:34 time: 1452202354 datetime with offset: 2016-01-08 07:28:34 Fatal error: Uncaught Error: Call to a member function format() on string in /in/hMcht:6 Stack trace: #0 {main} thrown in /in/hMcht on line 6
Process exited with code 255.
Output for 5.6.0 - 5.6.25
datetime: 2016-01-07 22:32:34 time: 1452202354 datetime with offset: 2016-01-08 07:28:34 Fatal error: Call to a member function format() on string in /in/hMcht on line 6
Process exited with code 255.
Output for 5.5.0 - 5.5.38
datetime: 2016-01-07 22:32:34 time: 1452202354 datetime with offset: 2016-01-08 07:28:34 Fatal error: Call to a member function format() on a non-object in /in/hMcht on line 6
Process exited with code 255.

preferences:
99.79 ms | 401 KiB | 104 Q