Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117892 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94122 invoked from network); 9 Jun 2022 17:33:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Jun 2022 17:33:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 98838180503 for ; Thu, 9 Jun 2022 12:19:29 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29838 64.147.123.0/24 X-Spam-Virus: No X-Envelope-From: Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (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 12:19:28 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id B3E42320095F for ; Thu, 9 Jun 2022 15:19:27 -0400 (EDT) Received: from imap52 ([10.202.2.102]) by compute1.internal (MEProxy); Thu, 09 Jun 2022 15:19:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to; s=fm2; t=1654802367; x=1654888767; bh=V7l+mbc9BfY8WYNcq369U06A0 DzGhGbPvnKreqSkSlw=; b=EoKZsMHDNuFsKjiFVIZrShvAuyXqpiUYME/tFs4Lk l3iWZFWLpzfv0JfNIATdIA4R7AvLbxtp5l/AppsyrE5kZ9dgkuNq0C3C1Cyw2YUs HUqfts/W6wnRFeII5fSt4EevUQvHs41hK4v4AXTbixEknXYzZR+4FO1IT+4ZaKDK T/2+fSeOpUSmQ2WZz6A87eCyl16E/ZK56oEiw86lznp++560Rb33u88QEjwY/m/n jNeiV5s/K1hMTTWwgMxUGnLGzYmP96ThL+ROMUL3ZXeJms7U8PAsWQpF3MaLlz1I igEUzdXa4sz6D3mQR2D1GELDivCfGMPzgCjJVZ5BnGbUQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1654802367; x=1654888767; bh=V 7l+mbc9BfY8WYNcq369U06A0DzGhGbPvnKreqSkSlw=; b=eDtUH2yvwb3aLDUcl dcwgGGzJqCzlYPtGoeF7/8s/euljqWI4k34sSaF7NkBCkPA1Kivnl3Ptx88SnL8K +8uo7wIMVoQ+wt92F+GSmwao9gm0UxdH1Rv+Z0l4kg0sH4gHIXP+NZ/ScDe7Q+Bi AI6fS3RKd5DJeel0XqAPEGcnRYHS2Oqqq4hm9EMK5mwPU3mUtFua4NYMtse8RYxZ gt4Su7euuMgakTm/YLstBLCyIeVBZtGlPMyNWt8M8AT0FiAsyLPJ5vWaXGGo1Wiu 5p3JTD/I8Sw8LgpFn/DD9L6D7Pn0oYi2VuHP/8aMj+yMT4niLwvxzYMlqzxFhK04 6ISdA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedruddtledgudeftdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepfdfn rghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrd gtohhmqeenucggtffrrghtthgvrhhnpeeggeehgfetjeehgefggefhleeugefgtdejieev vdethfevgeeuudefleehvdetieenucffohhmrghinhepphhhphdrnhgvthenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghr fhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id E634CC6008A; Thu, 9 Jun 2022 15:19:26 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-692-gb287c361f5-fm-20220603.003-gb287c361 Mime-Version: 1.0 Message-ID: <894eae13-a26b-4f30-be26-1859a308e0f8@www.fastmail.com> In-Reply-To: References: <2b35605f-8da8-46b1-aec3-00bd1bfe47fd@www.fastmail.com> Date: Thu, 09 Jun 2022 14:19:05 -0500 To: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3 From: larry@garfieldtech.com ("Larry Garfield") On Thu, Jun 9, 2022, at 1:36 PM, Micha=C5=82 Marcin Brzuchalski wrote: > Hi Larry, > > czw., 9 cze 2022 o 18:34 Larry Garfield napis= a=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 compac= tness >> of short-closures. That RFC didn't fully go to completion due to con= cerns >> 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 implement= ation >> 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 decline= d 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 correc= tly > and if they don't block in future "short-methods"? > > Cheers, > Micha=C5=82 Marcin Brzuchalski The short-functions RFC is entirely separate. The syntax choices in bot= h that RFC and this one were made to ensure that they don't conflict wit= h each other, and the resulting syntax meaning is consistent across the = language. The implementations are independent and should in no way conf= lict. (The short-functions RFC would have enabled short-methods too. It was p= urely a syntax sugar with no additional behavior.) That's assuming the attitude toward the short-function RFC ever changes = enough in the future to make it worth trying again... --Larry Garfield