3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $timetocomp = "2015-05-27 12:32:53"; $dateTimeToCompare = date_create_from_format('Y-m-d H:i:s', $timetocomp); $dateTimeNoW = new DateTime(); $diff = $dateTimeToCompare->diff($dateTimeNoW); if($diff->h >= 1) { echo "difference of at least 1 hour"; } else { echo "difference less than 1 hour"; }
based on h2HUs
Output for 5.3.0 - 7.2.0
difference of at least 1 hour
Output for 5.0.0 - 5.2.17
Fatal error: Call to undefined function date_create_from_format() in /in/TZCl5 on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_create_from_format() in /in/TZCl5 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_create_from_format() in /in/TZCl5 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_create_from_format() in /in/TZCl5 on line 3