note 57288 deleted from language.constants by betz
| From: | betz@php.net | Date: | Thu, 29 Sep 2005 15:39:08 +0000 |
| Subject: | note 57288 deleted from language.constants by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-95982@lists.php.net to get a copy of this message | ||
Note Submitter: nick dot brown at coe dot int
----
I have been happily including constant definitions without putting the name of the constant in
quotes:
define(c_bilingual_yes, "Yes@@Oui");
define(c_bilingual_no, "No@@Non");
Today I switched on a lot of error checking flags (E_ALL) and got strange messages ("using an
undefined from some of my define() statements:
Notice: Use of undefined constant c_bilingual_yes - assumed 'c_bilingual_yes' in
/var/www/nick/subscribe.php on line 20
The constants giving the problem are the ones that are in my main script body, rather than the ones
in the include files. Specifically, it appears that, if you have E_ALL (but I can't say right
now which bit is causing it - perhaps E_NOTIFY, I'm a beginner with error checking), then you
are only allowed to have constant names without the quotes in include files. (It's probably a
bit more subtle than that, but that's where I've got to so far). Strange.
So now, for my constants which I only want in one PHP file rather than a more global include file, I
have to write:
define("c_bilingual_yes", "Yes@@Oui");
After that, I can still *refer* to the constant without putting its name in quotes, without an error
message. Weird...