|
Posted by Richard Levasseur on 03/12/06 23:30
define('key', 'foobar', false);
$a = array('key'=>'value');
echo "$a[key]<br>";
echo "{$a[key]}<br>";
echo "{$a['key']}<br>";
output:
value
Errno: 8, Undefined index: foobar
value
It would seem constants are only expanded if they're in {}, and are
treated like strings otherwise. I wonder when this was changed, or if
its unintentional?
Navigation:
[Reply to this message]
|