3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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 +0900'); 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');
based on Fs9Am
Output for 7.0.0 - 7.0.4, 7.0.6 - 7.2.0
datetime: 2016-01-07 22:42:40 3600 time: 1452202960 Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/2YQ85:5 Stack trace: #0 {main} thrown in /in/2YQ85 on line 5
Process exited with code 255.
Output for 7.0.5
datetime: 2016-01-07 22:42:41 3600 time: 1452202961 Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/2YQ85:5 Stack trace: #0 {main} thrown in /in/2YQ85 on line 5
Process exited with code 255.
Output for 5.6.0 - 5.6.28
datetime: 2016-01-07 22:42:40 3600 time: 1452202960 Fatal error: Call to a member function format() on boolean in /in/2YQ85 on line 5
Process exited with code 255.
Output for 5.5.0 - 5.5.19, 5.5.21 - 5.5.37
datetime: 2016-01-07 22:42:40 3600 time: 1452202960 Fatal error: Call to a member function format() on a non-object in /in/2YQ85 on line 5
Process exited with code 255.
Output for 5.5.20
datetime: 2016-01-07 22:42:41 3600 time: 1452202961 Fatal error: Call to a member function format() on a non-object in /in/2YQ85 on line 5
Process exited with code 255.