Hi all,
On Tue Dec 13 09:32:43 2011, Morfi wrote:
echo "foobar"["foo"][0];
"foobar"["foo"] - Why not "undefined index"?
Exactly. The index/key "foo" does not really exist in the string
"foobar" because a string is more an indexed array of characters than a
combination of substrings (as the key "foo" could suggest).
"foobar"[3] has a well-defined meaning, but "foobar"["foo"] sounds
strange for me :-). Which semantics do you attached to this syntax?
Cheers.
--
Ivan Enderlin
Developer of Hoa
http://hoa.42/ or http://hoa-project.net/
PhD. student at LIFC/DISC (Vesontio) and INRIA (Cassis)
http://lifc.univ-fcomte.fr/ and http://www.inria.fr/
Member of HTML and WebApps Working Group of W3C
http://w3.org/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php