Putting aside for a minute how evil global variables may be, let me break this down to a more generic problem that I've spotted: using string array keys instead of variables.
Typing string array keys may lead to typos which may be tricky to spot: $GLOBALS['var1']
vs $GLOBALS['varl']
(one vs lamda).
If you have a modern IDE that does autocompletion you will find it useful to declare global $variable
and then, when typing it in, to invoke autocompletion to get an indication you didn't make a typo.
Such a modern IDE may also have occurences highlighting which will help with avoiding typos (you can see if it appears nearby) as well as navigating your code. It, again, will only work with variables and not array keys.
If you need to use globals then using $GLOBALS
may be better in reminding you where the variable came from when you're hunting down some value. It might, however, pay off to atleast define the variable names as a constant to take advantage of IDE autocomplete and occurence highlighting: $GLOBALS[_VAR1]
.
Ofcourse these nifty features also work with class variables which is yet another reason to consider refactoring :)