Re: Re: [RFC] Arrow functions / short closures

From: Date: Wed, 10 Apr 2019 08:33:04 +0000
Subject: Re: Re: [RFC] Arrow functions / short closures
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-105192@lists.php.net to get a copy of this message
Those parentheses are important when having multiple argument On 10 April 2019 10:02:46 AM Markus Fischer <markus@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


« previous php.internals (#105192) next »