since when does 0=="ug" ?? The output of this script is "ug":
$val = 0;
switch($val) {
case "ug":
echo "ug\n"; // this line of code gets executed
break;
case "gd":
echo "gd\n";
break;
case "cc":
echo "cc\n";
break;
case "jr":
echo "jr\n";
break;
default:
throw new Exception("not a valid college type");
}
I see from the docs that switch does a loose comparison but this behavior seems totally wrong to me.