Should we also write about the following?

a) "$arr[foo]" is fine for array key 'foo', no E_NOTICE here
b) "{$arr['foo']}" is the same as (a) above, and preferred
c) "{$arr[foo]}" checks for a constant named foo, not 'foo', and if no constant named foo exists throw E_NOTICE but still works
d) and of course "$arr['foo']" gives us a parse error (except in
4.3.0-1 it throws a strange E_NOTICE (and does not work) but we don't need to worry about that ;-)


This sort of information already lives within the types section
of the manual (for both array and strings) but since the array() docs were recently edited I wonder if it should include even more
information as opposed to just partial information as one doesn't "need" to use curly braces here (as suggested by the example), it's just a preferred method. These sorts of questions do come up a lot and I think it should even be mentioned in the tutorial and/or faq especially since people use superglobals all over the place these days. What do you guys think?

Just link the types section in here.

Goba

Reply via email to