I found this gem today (reduced down just a little):
<?php
switch (true) {
case ($perm->CanRead('permission1') || $perm->CanRead('permission2')):
break;
case ($some_other_condition_expression):
break;
case ($one_last_expression):
break;
}
I was floored. I was amazed that (and sickened) that first PHP allowed that and second that someone actually thought it was a good idea to use it. And to top it off, we found that the second two cases were never going to be true and were completely useless.