Undefined variables
| From: | Ernesto | Date: | Sun, 31 Mar 2002 01:30:55 +0000 |
| Subject: | Undefined variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-90841@lists.php.net to get a copy of this message | ||
Hi, newbie here.
I was erroneously using "error_reporting=E_ALL ~E_NOTICE" on my debug
server.
Now, I changed it to "error_reporting=E_ALL" and I can see lots of warnings
about using undefined variables.
So, if I don't want to see warnings all over the place, I have to check
every variable with isset() before I use it.
Is it necesary that I do this all the time? Why can't I trust on the
"emptiness" of uninitialized variables?
I'm using "register_globals=Off", so there should be no problem with that.
I know it's a good practice to declare and initialize all variables, but I
need my scripts to run as fast as they can (and I'm too lazy to check every
variable before I use it, too :-)
So... do I have any choice?
Regards,
Ernesto