Something else to consider, too. I'm not sure if this code is physically faster, but it's shorter and cleaner:
function findEnd($date) {
$dow = array("Sun" => -1,"Mon" => -2,"Tue" => -3,
"Wed" => 3,"Thu" => 2,"Fri" => 1,"Sat" => 0)
$end = $date + (86400 * $dow[date("D",$date)]);
}
In fact, if you wanted to do it mathematically, that's a possibility too. The good thing about this is that it's easily adjustible:
function findend($date) {
$datetime = $date-259200; // subtract 3 days;
$end = date(r,$datetime + 86400*(6-date(w,$datetime)));
}