Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117891 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 90321 invoked from network); 9 Jun 2022 16:50:17 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Jun 2022 16:50:17 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3BB95180544 for ; Thu, 9 Jun 2022 11:36:36 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-vk1-f180.google.com (mail-vk1-f180.google.com [209.85.221.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 9 Jun 2022 11:36:35 -0700 (PDT) Received: by mail-vk1-f180.google.com with SMTP id 140so2113142vky.10 for ; Thu, 09 Jun 2022 11:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mI/U0dBL5dL8dswyYpwl9dgdkxbSUPAKKL5j39irpgw=; b=Ceem/TXyfKSTd7EyzoojTN+E9wuIel/d/n/rZDk7hm3MdAgiT/X/LYHPVwC2sD7Ojy LNIpKKlaNJpcW2wQRFMiwymXG2wAXbQZNXAX3+8wG44jg5VxVcBo08RIpsh+Bnk40Y9P 5qVRmvnjMP+rdncQDIASyq6wvmuG7wXFKboQW4EU3QxQ72VPAaTkPt6yMrnYrox6EFV4 XGmknVYyFwB21qA0gA4YazzSnmYGaqj2h2oTaBntXKlNFDEi/FiybWg7RxBuQNwORFLz VKEcAaGbMeIHi0LraN9W2CoRzBFn/MVuka+188Fn2wubDzZiuY26h3Xh4HbloK6/5jwz kCRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mI/U0dBL5dL8dswyYpwl9dgdkxbSUPAKKL5j39irpgw=; b=3zuJvB168EBAaGBVNabxZrQr3C4fRqjoTIgm4kJX6RYu+R7ypfYrYyAxhsKcN2Pr3e SU3MgeUD4KpKKIyv/7KXiXTDm4nh4aoAazVYiA7bygzlPWUDc3QVtrvTz1hudV1ECn1I uL3DpOGODdl5I4C2RayBVX4r97jzzfzvfIWxAJcc3SNjaeVjswzj9fZt+nyGyjEDfiuK y1jHpPbPAEu5/dF33OguUX6U+Xg3lY08K0QOR37TZTB/scYJDVFTzULsh5T9HVQz9dBs o2736uPRrXnGGUP4KGoKr4DCP6V7EesdfTd+Cq0EXkO+Y+YvDewUmQzQyua+AGyfBM7M ePwg== X-Gm-Message-State: AOAM531Zam6zrTd27qkbNiuZboGRXAgVuzukSLd8UFJ6aM5wNf/ieeOm /HWrOJhm2yuR/SONW5xgLRd2sKKgHeumfGxfYORmLDnzgtM= X-Google-Smtp-Source: ABdhPJwxSusNFfmfWptymnEUbbHjowGB9eLnVuxYAwkgoNqAFSeJrZhCMti02uph6dPnfkn3hyryf26/N95kev7njrc= X-Received: by 2002:a05:6122:1802:b0:35e:255b:e273 with SMTP id ay2-20020a056122180200b0035e255be273mr9268741vkb.0.1654799794815; Thu, 09 Jun 2022 11:36:34 -0700 (PDT) MIME-Version: 1.0 References: <2b35605f-8da8-46b1-aec3-00bd1bfe47fd@www.fastmail.com> In-Reply-To: <2b35605f-8da8-46b1-aec3-00bd1bfe47fd@www.fastmail.com> Date: Thu, 9 Jun 2022 20:36:23 +0200 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="000000000000f1c80105e1081919" Subject: Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3 From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Marcin_Brzuchalski?=) --000000000000f1c80105e1081919 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Larry, czw., 9 cze 2022 o 18:34 Larry Garfield napisa=C5= =82(a): > Last year, Nuno Maduro and I put together an RFC for combining the > multi-line capabilities of long-closures with the auto-capture compactnes= s > of short-closures. That RFC didn't fully go to completion due to concern= s > over the performance impact, which Nuno and I didn't have bandwidth to > resolve. > > Arnaud Le Blanc has now picked up the flag with an improved implementatio= n > that includes benchmarks showing an effectively net-zero performance > impact, aka, good news as it avoids over-capturing. > > The RFC has therefore been overhauled accordingly and is now ready for > consideration. > > https://wiki.php.net/rfc/auto-capture-closure Nice work. Well-described behaviors. One question, more around future scope or related functionality in the future: A future RFC for "short-methods" described here in one of your declined RFC https://wiki.php.net/rfc/short-functions in the past could be revived with no conflicts in the scope of methods? class Foo { public string $firstName =3D 'John'; public function getFirstName(): string =3D> $this->firstName; } I'm asking if I understand the scopes of this and previous RFCs correctly and if they don't block in future "short-methods"? Cheers, Micha=C5=82 Marcin Brzuchalski --000000000000f1c80105e1081919--