3v4l.org

run code in 300+ PHP versions simultaneously
<?php function calcDays($startdate, $enddate) { $first = $startdate < $enddate ? $startdate : $enddate; $second = $startdate < $enddate ? $enddate : $startdate; $inbetween = $second - $first; $hours = floor($inbetween / 60 / 60); $minutes = floor($inbetween / 60 - $hours / 60); return $hours . " " . $minutes; } echo calcDays(1388385927, 1388390027);

preferences:
51.52 ms | 402 KiB | 5 Q