3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //echo date("Y-m-d H:i:s", time()); $dt = (new DateTime("2006-12-12"))->format('Y-m-d H:i:s')->setTime(0, 0); echo $dt; //$dt->setTime(0, 0); //echo $dt->format('Y-m-d H:i:s');
based on BjC1r
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to a member function setTime() on string in /in/VIbQc:3 Stack trace: #0 {main} thrown in /in/VIbQc on line 3
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Fatal error: Call to a member function setTime() on string in /in/VIbQc on line 3
Process exited with code 255.
Output for 5.5.0 - 5.5.38
Fatal error: Call to a member function setTime() on a non-object in /in/VIbQc on line 3
Process exited with code 255.