Hi,

To start with, I personally understand why a prefix character is needed
before parenthesis to make the parser simpler. I would like another simpler
option but will have to investigate more on this.

My question would be: whatever syntax we are going to use that has arrow
syntax, let's say *$f = \($x) => $x * 2;* are we going to also support the
arrow block version?:
*$f = \($x) => {*
*    // more operations that will have better visible on multi-line*

*    return $x * 2;*
*}*

This is present in other languages and was thinking that we could have it
in PHP also.

Regards,
Alex


On Wed, Mar 13, 2019 at 5:57 PM Nikita Popov <nikita....@gmail.com> wrote:

> Hi internals,
>
> Motivated by the recent list comprehensions RFC, I think it's time we took
> another look at short closures:
>
> https://wiki.php.net/rfc/arrow_functions_v2
>
> This is based on a previous (withdrawn) proposal by Levi & Bob. It uses the
> syntax
>
>     fn($x) => $x * $multiplier
>
> and implicit by-value variable binding. This example is roughly equivalent
> to:
>
>     function($x) use($multiplier) { return $x * $multiplier; }
>
> The RFC contains a detailed discussion of syntax choices and binding modes.
>
> Regards,
> Nikita
>

Reply via email to