RE: [PHP] Advice on Constants - Notice: Undefined Constant
| From: | Philip Olson | Date: | Wed, 09 Apr 2003 18:35:13 +0000 |
| Subject: | RE: [PHP] Advice on Constants - Notice: Undefined Constant | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143141@lists.php.net to get a copy of this message | ||
> Or should I be taking the notices as just a notice to let me know and that
> my code is fine?
This is a case-by-case basis. If you properly handle errors then
you should never see E_NOTICE. Blindly ignoring all E_NOTICE
level errors isn't ideal either although it's common especially
when hacking together some code. The most common cause of a
E_NOTICE error is:
if ($somevar) {
I'd say most typically $somevar is from a form :) Since you ask
about undefined constant, it could be a simple mistake of missing
some quotes or who knows... please post a small self-contained
example or two that demonstrates a specific question. Well, at
least I'm unsure what is being asked here as there are so many
possibilities.
Now while a script is in production you'll of course turn down
error_reporting and display_errors to 0 and rely on your error
handling scheme.
Regards,
Philip