Re: [RFC][Discuss] Arrow Functions

From: Date: Tue, 31 Jan 2017 12:38:33 +0000
Subject: Re: [RFC][Discuss] Arrow Functions
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-98077@lists.php.net to get a copy of this message
Alain Williams <addw@phcomp.co.uk> schrieb am Di., 31. Jan. 2017, 13:20: > On Tue, Jan 31, 2017 at 01:06:25PM +0100, Nicolas Grekas wrote: > > Or just drop any "fn" or "function" keyword, eg > > > > ($x, $y) => foo($x, $y); > > > > array_map(($x) => $x + 1); > > That has the great advantage of being much as Javascript does this. > > > > https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions As noted in the RFC, this isn't possible due to ambiguities with array keys and yield expressions with keys. Regards, Niklas > -- > Alain Williams > Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT > Lecturer. > +44 (0) 787 668 0256 http://www.phcomp.co.uk/ > Parliament Hill Computers Ltd. Registration Information: > http://www.phcomp.co.uk/contact.php > #include <std_disclaimer.h> > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.internals (#98077) next »