3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "datetime: " . date('Y-m-d H:i:s Z') . "\n"; echo "time: " . time() . "\n"; $date = DateTime::createFromFormat('Y-m-d H:i:s Z', '2016-01-07 22:28:34'); echo "datetime with offset: " . date('Y-m-d H:i:s Z', $date->format(DateTime::RFC2822) + 32400) . "\n"; echo "date now: " . date('Y-m-d H:i:s');
Output for 7.3.0 - 7.3.12, 7.4.0
datetime: 2016-01-07 22:43:25 3600 time: 1452203005 Fatal error: Uncaught Error: Call to a member function format() on bool in /in/g5XmO:5 Stack trace: #0 {main} thrown in /in/g5XmO on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.25
datetime: 2016-01-07 22:43:25 3600 time: 1452203005 Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/g5XmO:5 Stack trace: #0 {main} thrown in /in/g5XmO on line 5
Process exited with code 255.
Output for 5.6.0 - 5.6.28
datetime: 2016-01-07 22:43:25 3600 time: 1452203005 Fatal error: Call to a member function format() on boolean in /in/g5XmO on line 5
Process exited with code 255.
Output for 5.5.0 - 5.5.38
datetime: 2016-01-07 22:43:25 3600 time: 1452203005 Fatal error: Call to a member function format() on a non-object in /in/g5XmO on line 5
Process exited with code 255.

preferences:
87.74 ms | 401 KiB | 119 Q