3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $beginday=date(“Y-m-01″); $lastday=date(“Y-m-t”); $nr_work_days = getWorkingDays($beginday,$lastday); echo $nr_work_days; function getWorkingDays($startDate, $endDate){ $begin=strtotime($startDate); $end=strtotime($endDate); if($begin>$end){ echo “startdate is in the future! <br />”; return 0; }else{ $no_days=0; $weekends=0; while($begin<=$end){ $no_days++; // no of days in the given interval $what_day=date(“N”,$begin); if($what_day>5) { // 6 and 7 are weekend days $weekends++; }; $begin+=86400; // +1 day }; $working_days=$no_days-$weekends; return $working_days; } }
based on FSuEQ
Output for 5.4.0 - 5.4.34
Parse error: syntax error, unexpected '″' (T_STRING) in /in/TJQ4V on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/TJQ4V on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING in /in/TJQ4V on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/TJQ4V on line 3
Process exited with code 255.