Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104696 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 84173 invoked from network); 13 Mar 2019 23:36:43 -0000 Received: from unknown (HELO mail-vs1-f46.google.com) (209.85.217.46) by pb1.pair.com with SMTP; 13 Mar 2019 23:36:43 -0000 Received: by mail-vs1-f46.google.com with SMTP id y19so1855373vsc.4 for ; Wed, 13 Mar 2019 13:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RShDyGT+Qnogy2822qZJZqq4asOJEDCu1COSnFtUMvA=; b=pCcd5TRJE4Mo1QVpWRXJZ01Xcn8OX+4k0T0BiHLrL6JS2oDenH+XCS2bymA3VLWB6j WtYQtw3DPhpBwIhtnx2UsO5oimTLPeaAL2ioJ2zE5pehoLDUr0jd1KU8XaWi15VD2cZK N1Ry572D42Qv/i0L/zBXg6697LfGTbUlxoONXpqOSymoP4fRu97i79v2WEOv2euLRNCj kmXFV3q0urX6KDMM/+xaw1few4ZAb+ATDqcQWTu9cP/eg+I6GA94OrnTBWtV7Gh/3Ysc feNQzmqwVX/ouJh7f/mQcbkCZNex+MYymZkod9VbCu/EHsUDbgwpPtpzlL3FnnzfL4BV 6xQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RShDyGT+Qnogy2822qZJZqq4asOJEDCu1COSnFtUMvA=; b=ud79X5NciQVBu/e2xC4NqdfZmN+VMDlEJCzX9XBZDRETDXC1+6ElhyVE6HtgClofH8 4/0uif2EwO0J7OT8VU8A4m0boKzKCSo3bzBjU64AuQy+HxVLCY2uO2U5Y//5PdHLCc9/ Fdx668lFjRS/XBAyWa/NtaEWxBZgW9W7sR27+jJ9stBiHDPqD1NSI22+xXB6whZrjnz6 lbvvpd3PAJeTupuXTxc8zZAG4lbBU4jRzgK7V6YH5QnhonxWGjSVsHBgVyfwxx9XCDCL oQuZ/6Ch0zxep9tjk6vP36vXslbnmE9K6qvFF4FNj9dqrI5MNlUPulodDxC/Ue6TwlhI 7/6g== X-Gm-Message-State: APjAAAVN/NUly0lSXNMU7/smDzlaRxRA8oAbeV+9l7X2zYvd3jriw4rx gSJS1Kvtd0l+fJg6Ng34bFmUwajy2+UAjwHRBi4= X-Google-Smtp-Source: APXvYqxmjg2ludM/PnP8/bYZI0sTzIYQrs6zgtyC5f8PxbgriGEP3AC3ApOJjRgCm774Pn8VKzrnOITMgqr1mgy33ys= X-Received: by 2002:a67:ee8c:: with SMTP id n12mr6598622vsp.90.1552508815208; Wed, 13 Mar 2019 13:26:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 13 Mar 2019 21:26:43 +0100 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000070f7d40583ffa009" Subject: Re: [PHP-DEV] [RFC] Arrow functions / short closures From: travis.font@gmail.com (Travis van der Font) --00000000000070f7d40583ffa009 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Arrow functions are ternary operators to functions. While they are nice and shorten, they can be hard to read at times; considerably to people who aren't used to them which is surprisedly a majority of PHP programmers. Having them optional sure, but not necessary. Feel free to decide between fn() or f() as both are equivalently comprehensible to the same level of minimalism. Anyone considered? ($x) =3D> $x * $multiplier #mytwocents Kind regards / L=C3=A9if Gr=C3=A9iss, Travis van Font Le mer. 13 mars 2019 =C3=A0 16:57, Nikita Popov a = =C3=A9crit : > Hi internals, > > Motivated by the recent list comprehensions RFC, I think it's time we too= k > another look at short closures: > > https://wiki.php.net/rfc/arrow_functions_v2 > > This is based on a previous (withdrawn) proposal by Levi & Bob. It uses t= he > syntax > > fn($x) =3D> $x * $multiplier > > and implicit by-value variable binding. This example is roughly equivalen= t > to: > > function($x) use($multiplier) { return $x * $multiplier; } > > The RFC contains a detailed discussion of syntax choices and binding mode= s. > > Regards, > Nikita > --00000000000070f7d40583ffa009--