note 90085 deleted from language.types.string by danbrown
| From: | danbrown@php.net | Date: | Sun, 05 Apr 2009 19:17:45 +0000 |
| Subject: | note 90085 deleted from language.types.string by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-152840@lists.php.net to get a copy of this message | ||
Note Submitter: Jonathan (jojonaloha at gmail dot com)
----
In response to Jarobman
What you are experiencing isn't a bug, but it is an error. Those unquoted strings are being
interpreted as undefined constants.
From the documentation:
If you use an undefined constant, PHP assumes that you mean the name of the constant itself, just as
if you called it as a string (CONSTANT vs "CONSTANT"). An error of level E_NOTICE will be
issued when this happens. See also the manual entry on why $foo[bar] is wrong (unless you first
define() bar as a constant). If you simply want to check if a constant is set, use the defined()
function.
http://us2.php.net/manual/en/language.constants.syntax.php
Hope that helps!