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; $days = floor($inbetween / 60 / 60 / 24) $hours = floor($inbetween / 60 / 60 - $days * 24); $minutes = floor($inbetween / 60 - $hours * 60); return $hours . " " . $minutes; } echo calcDays(1388385927, 1488390027);
Output for 5.4.0 - 5.4.23
Parse error: syntax error, unexpected '$hours' (T_VARIABLE) in /in/P5Meq on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/P5Meq on line 9
Process exited with code 255.

preferences:
180.61 ms | 1395 KiB | 60 Q