Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112253 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60702 invoked from network); 18 Nov 2020 22:14:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Nov 2020 22:14:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CD2231804B3 for ; Wed, 18 Nov 2020 13:38:16 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com [209.85.217.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 18 Nov 2020 13:38:16 -0800 (PST) Received: by mail-vs1-f43.google.com with SMTP id v8so1389508vso.2 for ; Wed, 18 Nov 2020 13:38:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=AGvih0iQrvIwAvUB2rhAKkhwOXCMBijDsd8gO/0TTEU=; b=mCLswKUUO4inE8kCweF6HCY4ZA0yFHRbYwLaeHcwHe005iZL7gE/5uNxZ4ubLV9DNe 3hKD7ElrJ+0V+w90EsyNbnKvwk9PRlFXAXX+0LgR4dbqb+hSUMFbglsIrnirIT8YcD+V wT3B/WVchjgtELdtAoFzYMIc3GSxLRym1Ez+bvB4ZzNT00dpH1JzaDJMyWlJVqgtiQPy yvQiAGWyM2VIX8CrGT0OdcWPLaTbXwmYbEP79lhf8AvMVrhQj9s/UL3QKisBN7t7QsHC z9/1phGqsUVc/kBO//y9eETdaCqN8oX5RNF6MRk9T9VkH/q6j37HDT/sTqc+ktfrZ3Rx SciA== 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:content-transfer-encoding; bh=AGvih0iQrvIwAvUB2rhAKkhwOXCMBijDsd8gO/0TTEU=; b=ug2rNui8k3QqRLcKJ+xQ3fzO21NPlsqtD6WRcM/JCyanH66Rg0OpzIWwz/gIGbMfCC W8a0hBHuRUOjpVRBeFDSZqtnVX2NtpiHcyr2WBkI5mFwlbCJUeARL+KkRkacix2LJFWy ib4gp54aiKWVNCvrT572Blh5F01INeFvEaIjDl7u4k7iZn5zjQiaLXbYYsdLpbTDguzE 0c/3Cii491zJrgr8yd28SXWLiNNnDxTeVZcliZzUBNbchoFH/7K9/SGMPWSU0S6OCr6s irSqNzodHs3DoC0zNHe6d6E4Fs3fX6lzTXumVpoy9YzefaIR/YOKgXjB36camUiVFWq3 /DdQ== X-Gm-Message-State: AOAM530ZHFi5b2jk0aqybcgFllUEH4dWvXsmP4YSbhacjOpugiiywpKY dX9SNfPQiZ3nPGlu5Ht1tTD2vZObCnVjIkxU+4Jh7w== X-Google-Smtp-Source: ABdhPJwrrWbIfuWJ5cDHgxYOT9og/hW8P06KtRq05xNTJBe6oVcmq21DijGsFSFBVaZtxGB+AOz/XFSjMai01K1VNgU= X-Received: by 2002:a67:2246:: with SMTP id i67mr5785641vsi.3.1605735493745; Wed, 18 Nov 2020 13:38:13 -0800 (PST) MIME-Version: 1.0 References: <55e200cf-ed16-e935-4e09-728ce3362cba@gmx.de> In-Reply-To: Date: Wed, 18 Nov 2020 21:38:02 +0000 Message-ID: To: David Rodrigues Cc: "Christoph M. Becker" , Hans Henrik Bergan , PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Draft - Closure self reference From: Danack@basereality.com (Dan Ackroyd) On Wed, 11 Nov 2020 at 18:37, David Rodrigues wrot= e: > > My suggestion is to reuse the keyword `as` to set a variable that will re= present its own > closure. It is more flexible once that we could choose any name and reuse= in nested closures. > It is pretty similar to how SQL works too. Hi David, That's a pretty reasonable suggestion, as it's less magic and less BC break= ing. I've updated the words of the RFC to that, but am even less sure of how if/how that could be implemented... Michael Vo=C5=99=C3=AD=C5=A1ek wrote: > by allowing to specify/capture the variable after the function is assigne= d: > > $f =3D function () use ($f) {...}; Unfortunately that's not how PHP works. The assignment to $f doesn't happen until after the closure has been created. That's why currently the variable can be passed in by reference....but that has the undesirable problem that the RFC seeks to avoid. cheers Dan Ack