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; $hours = floor($inbetween / 60 / 60); $minutes = floor($inbetween / 60 - $hours / 60); return $hours; } echo calcDays(1388385927, 1388390027);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
1