I agree the scope is enough. Going with what Rowan added in about individual indexes (not slicing) by position to be added in with this, since the two go together.
In my opinion, the $thing[-1] should be a separate RFC, since it has little to do with slicing, which is the primary focus of this RFC. On 20 March 2015 at 16:17, Leigh <lei...@gmail.com> wrote: > > 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 >