3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo date('H:i:s Y-m-d',strtotime("midnight today")); $d = new DateTime("2015-11-05 16:00:00") - new DateTime("midnight today"); echo "[" . $d->format('Y-m-d H:i:s') . "]\n";
based on UMRUi
Output for 7.0.0 - 7.2.0
00:00:00 2015-11-05 Notice: Object of class DateTime could not be converted to int in /in/TtX5U on line 4 Notice: Object of class DateTime could not be converted to int in /in/TtX5U on line 4 Fatal error: Uncaught Error: Call to a member function format() on integer in /in/TtX5U:5 Stack trace: #0 {main} thrown in /in/TtX5U on line 5
Process exited with code 255.
Output for 5.6.0 - 5.6.25
00:00:00 2015-11-05 Notice: Object of class DateTime could not be converted to int in /in/TtX5U on line 4 Notice: Object of class DateTime could not be converted to int in /in/TtX5U on line 4 Fatal error: Call to a member function format() on integer in /in/TtX5U on line 5
Process exited with code 255.
Output for 5.5.0 - 5.5.38
00:00:00 2015-11-05 Notice: Object of class DateTime could not be converted to int in /in/TtX5U on line 4 Notice: Object of class DateTime could not be converted to int in /in/TtX5U on line 4 Fatal error: Call to a member function format() on a non-object in /in/TtX5U on line 5
Process exited with code 255.