|
Posted by Norman Peelman on 03/13/06 00:32
"Richard Levasseur" <richardlev@gmail.com> wrote in message
news:1142199015.476842.320290@i40g2000cwc.googlegroups.com...
> 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?
>
Interesting enough that in all actuality, you don't need to use curly
braces unless you are dealing with multi-dimensional arrays...
Norm
--
FREE Avatar hosting at www.easyavatar.com
Navigation:
[Reply to this message]
|