note 76304 added to language.constants
| From: | tudor at tudorholton dot com | Date: | Tue, 10 Jul 2007 00:15:13 +0000 |
| Subject: | note 76304 added to language.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128350@lists.php.net to get a copy of this message | ||
Note that constant name must always be quoted when defined.
e.g.
define('MY_CONST','blah') - correct
define(MY_CONST,'blah') - incorrect
The following error message also indicates this fact:
Notice: Use of undefined constant MY_CONST - assumed 'MY_CONST' in included_script.php on
line 5
Note the error message gives you some incorrect information. 'MY_CONST' (with quotes)
doesn't actually exist anywhere in your code. The error _is_ that you didn't quote the
constant when you defined it in the 'assumed' file.
----
Server IP: 203.202.10.60
Probable Submitter: 218.214.132.30
----
Manual Page -- http://www.php.net/manual/en/language.constants.php
Edit -- https://master.php.net/note/edit/76304
Del: integrated -- https://master.php.net/note/delete/76304/integrated
Del: useless -- https://master.php.net/note/delete/76304/useless
Del: bad code -- https://master.php.net/note/delete/76304/bad+code
Del: spam -- https://master.php.net/note/delete/76304/spam
Del: non-english -- https://master.php.net/note/delete/76304/non-english
Del: in docs -- https://master.php.net/note/delete/76304/in+docs
Del: other reasons-- https://master.php.net/note/delete/76304
Reject -- https://master.php.net/note/reject/76304
Search -- https://master.php.net/manage/user-notes.php