3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function calcDays($startdate, $enddate) { $first = $startdate < $enddate ? $startdate : $enddate; $second = $startdate < $enddate ? $enddate : $startdate; $inbetween = $second - $first; $minute = 60; $hour = $minute * 60; $day = $hour * 24; $days = floor($inbetween / 60 * 60 * 24); $hours = floor($inbetween / $hour - $days * 60 * 60); $minutes = floor($inbetween / $minute - $hours * $minute - $days * $hour); return $days . " " . $hours . " " . $minutes; } echo calcDays(1388385927, 1488390027);
Output for 4.3.0 - 5.2.1, 5.2.7 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
2400098400 -8640354212222 5.0978090016006E+14
Output for 5.2.2 - 5.2.6
2400098400 -8640354212222 509780900160060