3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date1 = new DateTime(time()); $interval = new DateInterval('PT1H5M'); $date2 = $date1->clone(); $date2->add($interval); $diff = $date2->diff($date1); echo $diff->format('%i') /*...*/; echo ($date2->getTimestamp() - $date1->getTimestamp()) / 60;
based on Kvn3Q
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined method DateTime::clone() in /in/O5p1q:5 Stack trace: #0 {main} thrown in /in/O5p1q on line 5
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Call to undefined method DateTime::clone() in /in/O5p1q on line 5
Process exited with code 255.