Yeah, there's no shortcut at this point other than initializing a million variables. It's actually probably about a hundred, as the majority of the variables were correctly set in the course of doing business. I just never saw the point of setting variables to an empty string before trying to check them:
Code:
if ( $name == "FoulFoot" )
... now throws an error if I didn't previously declare
$name equal to something, whereas previously, it would just see that
$name doesn't equal
anything (since it doesn't exist) and so appropriately return
false. It's just a lot of unnecessary bloat to either declare a million variables up front (and hope you don't forget to add one to an increasingly large block of code), or else check to see if the variable is set first:
Code:
if ( isset($name) && $name == "FoulFoot" )
Working with arrays isn't any better, and it's actually a majority of the problems at this point:
Code:
if ( $name[3] == "FoulFoot" )
... throws a big old error, too, if the third element was not set. Declaring $name = array() up front wouldn't save you.
PHP is a bit of a mess overall,
IMHO, but rather than address the big issues, they continue to screw around with things like this. :/
Foul