Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124537 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id E9C8E1A00B7 for ; Sun, 21 Jul 2024 15:11:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721574807; bh=H8fgBMKVRVB5Dmon3CaM+BTSyu1HFBNHXhCazdNU4+I=; h=Date:From:To:Subject:In-Reply-To:References:From; b=dieVmhx9oyPTwVZDf0G1qITi27hRTunZYwW2Ir5a1hiFADlGBUfOI+eeomM7BCYJy mnFGcYCtvDwfSN/R4S5say3hlyHiNcuKNK3ZpcOqGO1OQx2nz3aEQg7PjA6R2iXhIV LCU7P3mamnvFFUuFO9X8IOuxPYTAOPjBWCP5az/s/mh3XlgoAyaQ1zZWP7OQpxvLWB Ephmn9PVEvkTE9qAx61Ds6njLcOdPwP/pq6oNEWXiTTvRCEfMI9be2tKC/RguNRKkc YVymMaDYDdMaVr1WfwnfgXDBBYYIU3w7wcQJNcqyQz+45Tg83KvUzHbvIX15kLfT/1 pnTOgYy1eQCvA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F036C18003F for ; Sun, 21 Jul 2024 15:13:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout4-smtp.messagingengine.com (fout4-smtp.messagingengine.com [103.168.172.147]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 21 Jul 2024 15:13:25 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id DDD8B1380093 for ; Sun, 21 Jul 2024 11:11:51 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 21 Jul 2024 11:11:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1721574711; x=1721661111; bh=H8fgBMKVRVB5Dmon3CaM+BTSyu1HFBNHXhCazdNU4+I=; b= N90fSHPt6dQHwwTR0j+YFTHrx2pM03guAGAf3IZnoYsnYmgGg02qz/NgOlFqihJd dpDwPd4i1CM6vDAdvShO+hniTMVEqBVS87cwSxwFXQdC0YvLVCNEzycjfl0UWEbR 4ek+kUz84MUDGlkJFSJW1FT0yLVn0MS6tyCJje8D2JCx2h1KudKYLzYdqh2vVuhx gitHBvVORIE14ghNCeQZ2tOAbes4HAi1E9vQ/fA4q5Ha7dtHC2S2mG+A1JTxrY75 Ctah3Kt9hUGuMbEaEkRHloGPG6FuEV5uqfHvx8iDR651+kJ4uWaxw9c2DCGMSQBI IHAKkBf/jUOn+J5WqEWsGQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1721574711; x= 1721661111; bh=H8fgBMKVRVB5Dmon3CaM+BTSyu1HFBNHXhCazdNU4+I=; b=E XBBB/fn2R8B0JGqjgyWqGGQIrjwoLHGcJo70Kn8NaH2UajxXpJWVo3wPRGuf2Ooh 5o4losOTBwT1rM7HnZzaz2oYYMoE9FlqGBWnmVH2W0xqv7tKLeMqqXZhcliqXL1c fh03bNOR2vumXFCcvEV+1flN0WMrAOFrtLrDTbzMnxRceYg+zUM4OjLDygz7iyE9 FDx2mKwJFcgZszUN+GiY+DoWD1ZY43yAIdI2hcN6WyvIQyseYR0NeJeSbhHuvs/5 E7zs8E2ORNefEON2mm2aoKlGqAeepkr4KoNK2RXA0mi/3FzLr4ddx9W7wWEhXwai lF9rzrSnbNSpdBwMRed3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrheehgdekiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffufggjfhfkgggtgfesrgejmh ertderjeenucfhrhhomhepfdftohifrghnucfvohhmmhhinhhsucglkffoufhorfgnfdcu oehimhhsohhprdhphhhpsehrfigvtgdrtghordhukheqnecuggftrfgrthhtvghrnhepge ehtdefuedtfedtudeuieeihfegledukefgudeggeevhfduhfefudelleegkeegnecuffho mhgrihhnpehgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehimhhsohhprdhphhhpsehrfigvtgdrtghordhukh X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sun, 21 Jul 2024 11:11:50 -0400 (EDT) Date: Sun, 21 Jul 2024 16:11:49 +0100 To: internals@lists.php.net Subject: =?US-ASCII?Q?Re=3A_=5BPHP-DEV=5D_Request_for_opinions=3A_bug_vs_f?= =?US-ASCII?Q?eature_-_change_intokenization_of_yield_from?= User-Agent: K-9 Mail for Android In-Reply-To: <86eef5d8-6ffc-45e0-8ed6-6201a414cfb7@bastelstu.be> References: <66984FD0.5090805@adviesenzo.nl> <6699F817.8070806@adviesenzo.nl> <9571bb82-9873-4319-9bd1-0361748335be@bastelstu.be> <669BDB00.70507@adviesenzo.nl> <669BE870.2050908@adviesenzo.nl> <86eef5d8-6ffc-45e0-8ed6-6201a414cfb7@bastelstu.be> Message-ID: <2C00EB00-0BA4-40F8-92A5-50B49A639AD6@rwec.co.uk> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=----CYY9BGP63YI61GBYEIIZ8W6PLCDAQM Content-Transfer-Encoding: 7bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") ------CYY9BGP63YI61GBYEIIZ8W6PLCDAQM Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 21 July 2024 12:25:27 BST, "Tim D=C3=BCsterhus" wro= te: >The change has also been explicitly acked by Gina and Christoph before Il= ija committed it and Bob also participated in the PR without raising concer= ns, so it's also not an unapproved change=2E The fact that none of them ant= icipated this side effect, doesn't make it unapproved=2E I note that Gina commented:=20 > This is kinda cursed=2E=2E=2E but sure why not=2E And Christoph wrote: > Let's say that I'm generally not happy with complicating the parser with= work-arounds, but this is okay for me=2E So, hardly a confident consensus that this was the right approach=2E Regar= dless, we are where we are, and there's general agreement that the current = implementation is not ideal, and that we can and should improve it, just no= t on how and in what version=2E Oddly, the crux of this debate seems to be less that all options have majo= r impact, and more that none of them do=2E If the implementation had caused= a serious security or performance regression, I don't think we'd have any = hesitation in backing it out if a better implementation wasn't ready; or co= ntrarily, if it had been a headline new feature, we wouldn't even be consid= ering that option=2E As it is, an improved implementation *is* proposed: https://github=2Ecom/p= hp/php-src/pull/15041 Comparing this purely against 8=2E2, it seems a reaso= nable compromise: consumers of the token stream still need to make a change= , but it's the slightly more intuitive one of "treat yield and from as sepa= rate tokens, which might have other tokens between"=2E Personally, I think = it's reasonable to consider that a bug fix to the original change, and push= it into 8=2E3=2E Projects using the token stream could detect the versions with the imperfe= ct implementation, and emit an error explaining the "bug" if a T_YIELD_FROM= token doesn't match /yield\s+from/ Projects parsing the source code on the= ir own will have to handle this however they handle contexts where comments= have always been allowed=2E The Ubuntu LTS situation is unfortunate, but maybe Ond=C5=99ej Sur=C3=BD w= ill have an opinion on what to do with the patch there=2E Regards, Rowan Tommins [IMSoP] ------CYY9BGP63YI61GBYEIIZ8W6PLCDAQM Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On 21 July 2024 12:25:27 BST, = "Tim D=C3=BCsterhus" <tim@bastelstu=2Ebe> wrote:
>The change ha= s also been explicitly acked by Gina and Christoph before Ilija committed i= t and Bob also participated in the PR without raising concerns, so it's als= o not an unapproved change=2E The fact that none of them anticipated this s= ide effect, doesn't make it unapproved=2E

I note that Gina commented= :

> This is kinda cursed=2E=2E=2E but sure why not=2E

And= Christoph wrote:

> Let's say that I'm generally not happy with c= omplicating the parser with work-arounds, but this is okay for me=2E
So, hardly a confident consensus that this was the right approach=2E Regar= dless, we are where we are, and there's general agreement that the current = implementation is not ideal, and that we can and should improve it, just no= t on how and in what version=2E

Oddly, the crux of this debate seems= to be less that all options have major impact, and more that none of them = do=2E If the implementation had caused a serious security or performance re= gression, I don't think we'd have any hesitation in backing it out if a bet= ter implementation wasn't ready; or contrarily, if it had been a headline n= ew feature, we wouldn't even be considering that option=2E

As it is,= an improved implementation *is* proposed: https://github=2Ecom/php/php-src/pull/15041=C2= =A0Comparing this purely against 8=2E2, it seems a reasonable compromise: c= onsumers of the token stream still need to make a change, but it's the slig= htly more intuitive one of "treat yield and from as separate tokens, which = might have other tokens between"=2E Personally, I think it's reasonable to = consider that a bug fix to the original change, and push it into 8=2E3=2E
Projects using the token stream could detect the versions with the im= perfect implementation, and emit an error explaining the "bug" if a T_YIELD= _FROM token doesn't match /yield\s+from/ Projects parsing the source code o= n their own will have to handle this however they handle contexts where com= ments have always been allowed=2E

The Ubuntu LTS situation is unfort= unate, but maybe Ond=C5=99ej Sur=C3=BD will have an opinion on what to do w= ith the patch there=2E

Regards,
Rowan Tommins=
[IMSoP]
------CYY9BGP63YI61GBYEIIZ8W6PLCDAQM--