note 11911 deleted from function.define by didou
| From: | didou@php.net | Date: | Fri, 12 Sep 2003 12:15:22 +0000 |
| Subject: | note 11911 deleted from function.define by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56376@lists.php.net to get a copy of this message | ||
Note Submitter: ndk@otello.alma.unibo.it
----
[Editor's Note:
This is expected behavior.
Within a string context, PHP assumes that bracketed string values after a valid identitifier name
are string keys for arrays.
--zak@php.net]
Seems there's an unhortogonal behaviour between defined constants and explicit constants when
inside double quotes:
define(ZERO, 0);
$ARR=array("zero", "nonzero");
echo "- $ARR[ZERO] - $ARR[0] -\n";
What one expects from the above code is thar "- zero - zero -" gets printed, instead
"- - zero -" is actually printed.