Re: $request problem
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: $request problem

From: Norman Peelman <npeelman@cfl.rr.com>
Date: Sun Mar 12 2006 - 23:32:56 CET

"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
Received on Mon May 1 02:32:05 2006