3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start= "2018-05-17 05:04:34"; $end = "2018-05-17 17:04:34"; //Note that it's intentionally reversed $diff = strtotime(substr($start,11))-strtotime(substr($end,11)); //If the calculation was reversed add one day in seconds if($diff <0) $diff += 86400; If($diff >3600){ Echo "more than one hour"; }Else{ Echo "less than one hour"; }

preferences:
164.31 ms | 405 KiB | 5 Q