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: Anonymous <anonymous@nowhere.invalid>
Date: Wed Mar 15 2006 - 18:31:32 CET

ColdShine wrote:

> >> echo "$arr[key]"; // foo
> >> echo "$arr['key']"; // parse error
> >
> > But these two are not. For the first case: Where in the manual does it
> > state that "$arr[key]" should be evaluated like $arr["key"]? For the
> > second: Within double quotes variables should be evaluated, so why
> > doesn't $arr['key'] evaluate to foo?
>
> This answers your questions:
> http://www.php.net/manual/en/language.types.string.php#AEN3054
>
> If you could not find this in the manual it's your fault, as it's just
> where... you should expect it to be :)

*LOL*, I swear, that wasn't there the last time I read that section! ;-)

But seriously, was that always in there or is that some recent addition?
It might be some time ago when I last read about string handling,
because I never had any problems with that. However, I usually don't use
less known constructions like these that don't make immediate sense,
because I still want to be able to understand my own code in a year.

But the bottom line for this thread is: You were right, it *is*
documented behaviour.

Bye!
Received on Mon May 1 02:34:03 2006