On PHPEverywhere today, there's a new posting from John talking about a little "scare" he's had with the defaults on his switch statements.
Here's a recent posting to the php-internals newsgroup that made me gasp with shock and horror, then switch over to HomeSite and perform a global search for all declarations of default in switch statements. This is certainly an unpleasant, Titanic-sized iceberg to me. In my opinion, this should be changed:
"Hello Everyone, I just discovered a small thing in the switch() statement. The position of the default: clause has to be at the end of the code. What changed?" to which Andi replies, "It's always been like that and has been documented for ages in the manual."
I'm going to agree with John on this one - presonally, I make a habit of putting them at the end of my switch statements, but I've seen a lot of code out there that puts it first (and then they wonder why it doesn't work correctly...




