Re: [RFC] Arrow functions / short closures

From: Date: Wed, 17 Apr 2019 21:16:28 +0000
Subject: Re: [RFC] Arrow functions / short closures
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-105313@lists.php.net to get a copy of this message
I like it. Only exception is: ``` fn&() => ...; ``` Which I would prefer to see reserved for the purpose that you've written as: ``` fn() use(&) => ...; ``` The & symbol of "return by ref", should be placed on the right of the parentheses, near the return type: ``` fn(int &$x)&: int => $x; fn(&$x)& => $x; ``` The same thing could be allowed on regular functions and methods. currently you'd write ``` public function &bar(): int{ /* ... */ } public function &baz(){ /* ... */ } ``` Since 7.4 one would be allowed to write this to mean the same thing: ``` public function bar()&: int{ /* ... */ } public function baz()&{ /* ... */ } ``` Would you guys agree on making a second RFC later changing this after and if this RFC passes and before 7.4 is released?

« previous php.internals (#105313) next »