Re: RFC - Array slice syntactic sugar
| From: | Leigh | Date: | Fri, 20 Mar 2015 10:38:22 +0000 |
| Subject: | Re: RFC - Array slice syntactic sugar | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-85271@lists.php.net to get a copy of this message | ||
On 19 March 2015 at 21:03, Larry Garfield <larry@garfieldtech.com> wrote:
> Variations of this proposal have been discussed many times. I don't
> recall what the pushback was but it's worth your time to check the archives
> to see what the objections were and if you can address them, and/or if the
> new engine in PHP 7 addresses them. (I suspect it has/will ameliorate a
> lot of implementation-level issues with old proposals.)
>
I've tried implementing python style slice on both strings and arrays in
the past (I don't seem to have an existing branch with it in any more
though it seems). The biggest problems I hit were regarding the syntax, the
functionality itself worked.
Colons caused problems with ternary operators in the lexer, and I had an
issue with commas too, but I forget what it was. Of course these might have
been resolvable, but I didn't put too much effort into it.