3v4l.org

run code in 200+ 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 / $days * $day); $minutes = floor($inbetween / 60); return $days . " " . $hours . " " . $minutes; } echo calcDays(1388386746, 1388991546); echo PHP_EOL . 1388991546 - 1388386746;
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.2.0
7 7464960000 10080604800
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
7 7464960000 10080 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8rfGS on line 21 -1388386746