3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt1 = getdate() $dt2 = getdate() $date1 = date_create("".$dtl.""); $date2 = date_create("".$dt2.""); $dateDiff = date_diff($date2, $date1); $probDays = $dateDiff->days; $probMon = $dateDiff->m; $probYear = $dateDiff->y; $month = $probDays / 30; $totLeave = $month * 1; if($month > $probmon) { $totLeave = $totLeave + 1; } ?>
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected '$dt2' (T_VARIABLE) in /in/OVmRI on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/OVmRI on line 3
Process exited with code 255.

preferences:
176.39 ms | 1399 KiB | 65 Q