Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98109 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3486 invoked from network); 1 Feb 2017 16:05:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Feb 2017 16:05:55 -0000 Authentication-Results: pb1.pair.com header.from=weirdan@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=weirdan@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.48 as permitted sender) X-PHP-List-Original-Sender: weirdan@gmail.com X-Host-Fingerprint: 209.85.215.48 mail-lf0-f48.google.com Received: from [209.85.215.48] ([209.85.215.48:35650] helo=mail-lf0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/24-51557-26702985 for ; Wed, 01 Feb 2017 11:05:55 -0500 Received: by mail-lf0-f48.google.com with SMTP id n124so230499707lfd.2 for ; Wed, 01 Feb 2017 08:05:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3fLtpQMi36Huz5b7VQuY3m4gCQucW6QZINqK692dF7k=; b=C1OEowNUuGG+uc0NWjJmkmyNzs2bnxaTyqgK6+t4Sju18ORpUC3dHSBmR0nYo/8/T2 LFKGExp5WsWBhHORa5tG8Tc4vE10XOK+Jk4l/d5klUF43Ph9B4MadCliesr7repyp1nv JLY+5iLQBfFSCRX9rjl/rl52n+de4mMoNkndM9gjXGTVbH4YHunyb4DsC3qT7kSVHlP3 iRlpnggzfky3kpjIVl3JbAC9YHS28bdNLNeAUw+d6w7MTPNfUVryfP4bWkGzIej99DSW o241Kbf+Ye9lReLMAPN8lkXh0hbEn+TYFUmZJCoI8iYSbHCfAgAskM7+mZozmIxd4Slk NoFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3fLtpQMi36Huz5b7VQuY3m4gCQucW6QZINqK692dF7k=; b=oyGWIHyiAfttiwgC3jM8q2lR5W0XSbVWEF0wY92Ic1A7USgvEK0cjaNtlkJwW4Bo5o Tjg51HcyRST/BmVMX2BPw7pKlKj1yMEj/VBXrBSh+xZpq4xPB40KXFCgIQXc6g/3tsPP F75PelV+fnhtqmPJSIUXx9Yx/8tTAgqpQ7C5D46RYJOUbiymj8ARStkOkj9advlN5tu/ fMPVaKV/iCvvGI5Q03qL8+mqn3YBe5DK27BhZaXSIBxANkwD3JULPEKboTfAok4+mAex vT5INOXhkUoAtIwIsjLPxkBgL+/9KK+B4eDACxB5eRe4K6a8KburGiMfOKPwgPQzCpO2 qCIA== X-Gm-Message-State: AIkVDXIEOpY5KBZU5ESfDkoAwVlDTcavPyb88ZsCRkM1lg7YxjmmRH2vNZ+k74XrUqu06w== X-Received: by 10.46.9.20 with SMTP id 20mr1672602ljj.0.1485965151536; Wed, 01 Feb 2017 08:05:51 -0800 (PST) Received: from portable-ws (bb13.xyz. [195.138.83.92]) by smtp.gmail.com with ESMTPSA id h24sm4438371ljb.46.2017.02.01.08.05.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Feb 2017 08:05:50 -0800 (PST) X-Google-Original-From: Bruce Weirdan Received: from localhost (portable-ws [local]) by portable-ws (OpenSMTPD) with ESMTPA id 8b823b61; Wed, 1 Feb 2017 16:05:49 +0000 (UTC) Date: Wed, 1 Feb 2017 18:05:49 +0200 To: Rasmus Lerdorf Cc: PHP internals Message-ID: <20170201160548.7qxyjhlnpfepwmgs@portable-ws> References: <1E.BA.51557.966F0985@pb1.pair.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PHP-DEV] Re: [RFC][Discuss] Arrow Functions From: weirdan@gmail.com (Bruce Weirdan) On Wed, Feb 01, 2017 at 07:45:50AM -0800, Rasmus Lerdorf wrote: > 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. Does this mean, in the context of this RFC, that short-form lambdas won't have their own scope though? I think it's not clear from RFC. Example: // would this create $ret in the outer scope assuming $ret was not // defined array_map(fn($elt) => $ret[] = $elt, [1]); var_dump($ret); // NULL or array(1) ? Current implementation (available on 3v4l.org) does create a local scope, but it should probably be explicitly stated in the RFC (and docs, should the RFC get accepted).