Those parentheses are important when having multiple argument
On 10 April 2019 10:02:46 AM Markus Fischer <mar...@fischer.name> wrote:
On 10.04.19 00:10, Robert Hickman wrote:
- $waithandles = $this->urls->map(fn($url) => $this->fetcher->fetch($url));
- $waithandles = $this->urls->map(\($url) => $this->fetcher->fetch($url));
- $waithandles = $this->urls->map($url ==> $this->fetcher->fetch($url));
I would say that when lambda functions occurs in function calls I find the
\ or ==> syntax more readable.
To me, in that context, '==>' is the most readable as it does not have
parentheses on the argument. It's a bit visually noisy with them.
I concur, `==>` to me also stands out the most easiest to read without
too much parenthesis noise.
- Markus
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php