Re: Re: Support negative indexes for arrays and strings
| From: | Tjerk Meesters | Date: | Tue, 04 Sep 2012 13:43:24 +0000 |
| Subject: | Re: Re: Support negative indexes for arrays and strings | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62793@lists.php.net to get a copy of this message | ||
On 4 Sep, 2012, at 3:59 AM, Stas Malyshev <smalyshev@sugarcrm.com> wrote:
> Hi!
>
>> The terminology "negative indexing" seems to imply that the feature
>> should work with arrays. To restrict it to just strings might involve
>> creating a term one would only associate with strings.
>
> I do not see any way to change behavior of $array[-1] that would make
> sense. So either only strings get it or nobody gets it.
I suppose one could still extend ArrayAccess and have their own negative indices support for arrays
:)
>
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>