Re: Re: Negative string offset support: and arrays?

From: Date: Sun, 31 Oct 2004 00:28:32 +0000
Subject: Re: Re: Negative string offset support: and arrays?
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-13640@lists.php.net to get a copy of this message
Ilia Alshanetsky wrote:
I am well aware that at this point PHP has no separation between [] and {} as far as string offsets go. My initial suggestion was to add the support for negative offsets and not to limit it to a particular construct. Given that this is intended for strings only, I readily agreed with people who suggested that it should be available only for {}, assuming there was a separation.
What happens to arrays when there's no difference between [] and {} ? $array[-1] $string[-1] This will confused people because $array[-1] actually wouldn't return the last element (it could, if we know the indices are only positive integers, but we can't assume when that when using arrays with arbitrary keys -> hashes). That seems problematic to me. - Markus

« previous php.internals (#13640) next »