Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98108 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1612 invoked from network); 1 Feb 2017 15:46:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Feb 2017 15:46:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lerdorf.com designates 209.85.218.47 as permitted sender) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.218.47 mail-oi0-f47.google.com Received: from [209.85.218.47] ([209.85.218.47:36141] helo=mail-oi0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/D3-51557-AD202985 for ; Wed, 01 Feb 2017 10:46:35 -0500 Received: by mail-oi0-f47.google.com with SMTP id u143so235782399oif.3 for ; Wed, 01 Feb 2017 07:46:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lerdorf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=JjOvgWiQv0lqxTLbDQh2FcJDKF/W8xtP6XHNEy35PJI=; b=byZ+Tys/Pd1el4QpViDAZq+dnlKRU9frHkpMb1H1N2HCN0+C8gK/ZcpY0ruYa/8ChM ZHVSzpqikFbbItBR4tVaL+TWP7bgAQCT0c1wINTG+qQoZSJjN3Kn3riO8Dl/WP98jqQ9 hYbc+XcTTMHp4GChDeM9SMKhd6BDMS2+BUdeWe1qGKZjazbNJn/JNCPKOajLN9BMxBZX JkEi3Xv0jIZaIvO/sPc1Kn3Xqi3GL844h3R3TsyyLUQDPIWdMo+C1+DqTDm3OgHB5B4y UjnmWEEpwhzCPyHlQKjO0FCqJelQ+o7cWweTjS6jX6Iu5KXazxtzoL1SUj0SSWhTlRkP Ib+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JjOvgWiQv0lqxTLbDQh2FcJDKF/W8xtP6XHNEy35PJI=; b=pN+ZUMuynKWwxE5WENQQ0B8OycAwc+RFDN/miBsLdW89IT7UavgaHrAC0IPL7SsBzg Qr5+rYTq45BxIo7Lp+64NkfLOYq2XYMvK+6MagsRw+ilX1vSMRmep4IW4mKDIltvnr22 iu1y77EH0lTE/8+8fDqGCrIqA2OqmnPjlq3mv3/cDZdrMYeCM7T5r1B09FvpgRPWvQPk fS0Fuc4y3iKmZGXwF9EhfwH6hGlNG1svB/NWTErU68wisYegFkliw61SoAfG+/+Tpp7l A0SIeIRXz/uW4yYxbiqy6o5kiQEds4wYTkyLuF5XFI89i0ohw/jwhWJABFNCelFBOErI P09Q== X-Gm-Message-State: AIkVDXJLxOarV8cfluRcBB9lKtE4J6QZ267bLjKLBshuopN9PdEdbHYlq9o6lxXKjy/Uvlp1sh1lLWsRjQQ4Kw== X-Received: by 10.202.86.15 with SMTP id k15mr1721427oib.212.1485963991372; Wed, 01 Feb 2017 07:46:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.74.121.84 with HTTP; Wed, 1 Feb 2017 07:45:50 -0800 (PST) In-Reply-To: <1E.BA.51557.966F0985@pb1.pair.com> References: <1E.BA.51557.966F0985@pb1.pair.com> Date: Wed, 1 Feb 2017 07:45:50 -0800 Message-ID: To: Andrea Faulds Cc: PHP internals Content-Type: multipart/alternative; boundary=001a113d37ecdb03b2054779f3bf Subject: Re: [PHP-DEV] Re: [RFC][Discuss] Arrow Functions From: rasmus@lerdorf.com (Rasmus Lerdorf) --001a113d37ecdb03b2054779f3bf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Jan 31, 2017 at 12:41 PM, Andrea Faulds wrote: > > That's the idea. I'd prefer it if auto-capture was not restricted to > single-expression functions (=E2=80=9Carrow functions=E2=80=9D). Though a= rrow functions > make most sense with auto-capture, it doesn't need to be stricted to them= . This goes against a very basic characteristic of PHP. The fact that you have to be explicit about globals and outer scope variables leaves you with a clean sandbox with no side effects inside your function. Changing that, especially after the fact for existing closures, is a complete non-starter and would subtly break a ton of code. The reason it is feasible to do this for single-expression closures in this short form syntax is that you don't typically need a local scope at all for these short closures and the syntax doesn't convey the idea that you would have a local scope. -Rasmus --001a113d37ecdb03b2054779f3bf--