3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dtA = new DateTime("01-12-2015 6:55am"); $dtB = new DateTime('now'); $diff = $dtA->diff($dtB); if ( ( ($diff->days * 24 ) * 60 ) + ( $diff->i ) > 1440) echo "24 hours has passed. -> ".$dtB; else echo "has not reached the 24 hour mark. -> ".$dtB;
based on G9qEF
Output for 7.1.0 - 7.2.0
Recoverable fatal error: Object of class DateTime could not be converted to string in /in/vsTmT on line 7
Process exited with code 255.
Output for 5.3.28 - 5.3.29, 5.4.20 - 7.0.20
Catchable fatal error: Object of class DateTime could not be converted to string in /in/vsTmT on line 7
Process exited with code 255.
Output for 5.3.20 - 5.3.27, 5.4.10 - 5.4.19
Catchable fatal error: Object of class DateTime could not be converted to string in /in/vsTmT on line 9
Process exited with code 255.