3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $midnight = clone $endDate; $midnight ->setTime(24, 0, 0) ; $difference = $midnight->diff($now); var_dump($difference->format('%H:%I:%S'));
based on IVr0P
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: endDate in /in/ZYtM1 on line 3 Fatal error: Uncaught Error: __clone method called on non-object in /in/ZYtM1:3 Stack trace: #0 {main} thrown in /in/ZYtM1 on line 3
Process exited with code 255.
Output for 5.3.21 - 5.4.14, 5.4.16 - 5.6.28
Notice: Undefined variable: endDate in /in/ZYtM1 on line 3 Fatal error: __clone method called on non-object in /in/ZYtM1 on line 3
Process exited with code 255.
Output for 5.4.15

Process exited with code 137.