>When I run PHP scripts on my company's web server, I can attempt to read a
variable that has not already been declared.
When I try to access a variable before a value is assigned on my home
computer (Windows with IIS), I get a warning about the variable being
undefined.
Careful use of isset() on every variable that might be undefined
before trying to use its value will avoid this. Most any element
of $_GET, $_PUT, $_COOKIE, $_SERVER, etc. should be considered as
possibly undefined until proven otherwise. How you handle an
undefined variable is up to you: give it a default, skip the section
dealing with it entirely, display an error back to the user, or
whatever.
Is there a flag in php.ini that allows a script to check a variable before
defining it?
As far as I know, nothing in php.ini is required to use isset().
IMHO, you should consider each warning as a bug that needs to be fixed.
You should use error_reporting(E_ALL) on your company's server to
get the warnings.
Gordon L. Burditt