Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98142 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76784 invoked from network); 3 Feb 2017 19:18:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2017 19:18:16 -0000 X-Host-Fingerprint: 137.50.185.62 oa-edu-185-62.wireless.abdn.ac.uk Received: from [137.50.185.62] ([137.50.185.62:4005] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 19/45-38491-677D4985 for ; Fri, 03 Feb 2017 14:18:14 -0500 Message-ID: <19.45.38491.677D4985@pb1.pair.com> To: internals@lists.php.net References: Date: Fri, 3 Feb 2017 19:18:10 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Posted-By: 137.50.185.62 Subject: Re: [PHP-DEV] Re: [RFC][Discuss] Arrow Functions From: ajf@ajf.me (Andrea Faulds) Hi David, David Rodrigues wrote: > Hello folks! > I just not understand why "function" should be abbreviated. It's about "how > less character better"? I don't see it too much on PHP. I guess that is > more simple keep what exists current "function", that all knows about (that > should be better than the next example): > > $mapped = array_map(function($x) => $x + $y); // vs current: > $mapped = array_map(function($x) use($y) { return $x + $y }); I feel the same way. It would be nice to have shorter syntax, but it sacrifices readability and familiarity here, and adds yet another new keyword. It also feels inconsistent… isn't "fn" just short for "function"? Why is it exclusive to the => syntax? Thanks. -- Andrea Faulds https://ajf.me/