Re: [RFC]Call for voting about const array/string dereference

From: Date: Tue, 13 Dec 2011 09:27:59 +0000
Subject: Re: [RFC]Call for voting about const array/string dereference
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-56904@lists.php.net to get a copy of this message
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/

« previous php.internals (#56904) next »