On Mar 20, 2015 4:00 PM, "Alex Bowers" <bowersb...@gmail.com> wrote:
>>
>> IMHO, stick to offsets in the first instance, this is a slice notation,
first order of business is to make it behave like array_slice (+on
strings). Assoc key based slicing feels pretty wrong to me at this point.
>
>
> I have to agree, we are getting ahead of ourselves.
>
> A quick summary of what this RFC should cover:
>
> - Slicing an array or string based on the positional index.
>
> Things for future RFC consideration:
>
> - Slicing an array or string based on the key.
> - Index -1 for last item of list.
>
> Everybody agree that the only focus of this RFC should be the positional
index slicing?

I think that's plenty for initial scope, since at this point proposals are
targeting 7.1 there's plenty of time to get assoc indexing in if there is
enough support for this in the first instance.

If there is support for positional but not assoc, we don't want this
proposal to fail on the fact they are bundled together.

Not sure I understand your index -1 line (sorry, on phone in pub, really
just skimming mails). If you mean negative indices for positions from the
end of the array/string then +1 for this *with* the slice syntax.

For $thing[-1] I think this only works for strings (and I have this
implemented, should probably RFC it)
https://github.com/lt/php-src/tree/string_negative_offset

$thing[-1:] is in scope for arrays though

Reply via email to