3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set('Europe/Berlin'); $date = new DateTime(); $date->setDate(2015, 10, 25); $date->setTime(1, 30, 0); $date2 = clone $date; // Add two hours $date->add(new DateInterval('PT1H')); echo $date."\n"; $date->add(new DateInterval('PT0S')); echo $date."\n";
based on mZ9om
Output for 7.1.0 - 7.2.0
Recoverable fatal error: Object of class DateTime could not be converted to string in /in/UBEVM on line 10
Process exited with code 255.
Output for 5.3.19 - 7.0.20
Catchable fatal error: Object of class DateTime could not be converted to string in /in/UBEVM on line 10
Process exited with code 255.