The accepted answer in this question: Calculate business days is buggy. Just check
echo getWorkingDays("2012-01-01","2012-05-01",$holidays);
The problem is with this fragment:
$days = ($endDate - $startDate) / 86400 + 1;
So the minimal not working example is:
Why this expression:
($endDate - $startDate) / (60*60*24);
Is not an integer for:
$startDate = strtotime("2012-01-01");
$endDate = strtotime("2012-05-01");