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:35:17 3600 time: 1452202517 Fatal error: Uncaught Error: Call to a member function format() on bool in /in/CbLhN:5 Stack trace: #0 {main} thrown in /in/CbLhN on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.25
datetime: 2016-01-07 22:35:17 3600 time: 1452202517 Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/CbLhN:5 Stack trace: #0 {main} thrown in /in/CbLhN on line 5
Process exited with code 255.
Output for 5.6.0 - 5.6.38
datetime: 2016-01-07 22:35:17 3600 time: 1452202517 Fatal error: Call to a member function format() on boolean in /in/CbLhN on line 5
Process exited with code 255.
Output for 5.5.0 - 5.5.20, 5.5.22 - 5.5.35, 5.5.37 - 5.5.38
datetime: 2016-01-07 22:35:17 3600 time: 1452202517 Fatal error: Call to a member function format() on a non-object in /in/CbLhN on line 5
Process exited with code 255.
Output for 5.5.21, 5.5.36
datetime: 2016-01-07 22:35:16 3600 time: 1452202516 Fatal error: Call to a member function format() on a non-object in /in/CbLhN on line 5
Process exited with code 255.

preferences:
145.46 ms | 401 KiB | 188 Q