Re: RFC - Array slice syntactic sugar

From: Date: Fri, 20 Mar 2015 21:41:45 +0000
Subject: Re: RFC - Array slice syntactic sugar
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-85339@lists.php.net to get a copy of this message
> > Why not use array_slice for it? There certainly are ways to do most of what this RFC covers, however most of them don't lend themselves well to clean code in my opinion. Thats why this RFC is listed as being syntactic sugar. On 20 March 2015 at 21:30, Stanislav Malyshev <smalyshev@gmail.com> wrote: > Hi! > > > It would give different results, for a reason. There is currently no way > > to get an array item by positional index, whilst preserving the keys. > > I imagine having such way may be useful. However, reusing array access > syntax for that does not look like a good idea, since it would look like > existing array syntax but work completely different. Why not use > array_slice for it? > -- > Stas Malyshev > smalyshev@gmail.com >

« previous php.internals (#85339) next »