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 CbLhN
Output for 7.0.0 - 7.2.0
datetime: 2016-01-07 22:42:24 3600 time: 1452202944 Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/Fs9Am:5 Stack trace: #0 {main} thrown in /in/Fs9Am on line 5
Process exited with code 255.
Output for 5.6.0 - 5.6.28
datetime: 2016-01-07 22:42:24 3600 time: 1452202944 Fatal error: Call to a member function format() on boolean in /in/Fs9Am on line 5
Process exited with code 255.
Output for 5.5.0 - 5.5.37
datetime: 2016-01-07 22:42:24 3600 time: 1452202944 Fatal error: Call to a member function format() on a non-object in /in/Fs9Am on line 5
Process exited with code 255.