Re: Re: [RFC][Discuss] Arrow Functions
| From: | Michael Morris | Date: | Fri, 03 Feb 2017 22:22:43 +0000 |
| Subject: | Re: Re: [RFC][Discuss] Arrow Functions | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-98148@lists.php.net to get a copy of this message | ||
On Fri, Feb 3, 2017 at 3:34 PM, <ilija.tovilo@me.com> wrote:
> I like the suggested syntax. The only drawback I see is that it inhibits
> the future addition of union types for closures:
>
> |int | float $x| => $x
>
> Adding parentheses of course resolves the issue but looks a bit awkward:
>
> |(int | float) $x| => $x
>
> Apart from that I have nothing to complain about. I'd be happy either way.
>
Good point, but union types are going to come up in this context I think.
Remember, these are for one line functions, which highly limits what they
can do.
>
>