Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124538 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 650391A00B7 for ; Sun, 21 Jul 2024 16:42:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721580242; bh=DvTl1FzPXSJzu2igTcH84MhAbWkI1EgSA/PmTAE7xZs=; h=Subject:To:References:From:Date:In-Reply-To:From; b=TE9hGvs1SUFMAMb036dhgZT6C/JhkQLBYvTa65Pf3ob3UhLSOyz30jRywDvEwTDLK zM36WNypP3h19amBn5DLC/YLQHH23jT2WQB3PL7qcwwW1ljwX1jXpYzoRUtgauOi+W SsimMNcJsgD3bXLisFn4JsI94topOMshBSPJsbW1vu86o9YRod91amQMor8jVViqia W8clU59ZG1VJDUKQAY4u4lMYs0RIQPlBXlljZ9f0oVv0B/jkDMwBjoW2D75uoRqHAP mPz0fbfHx5l4CvVDqR1ugOJ5rqEMENCFxBMq5SKq+nrLq6FrkEmczZB8zroX98Ftbt 8+kU8cTpryheQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6E9DB180061 for ; Sun, 21 Jul 2024 16:44:01 +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=2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING, HTML_MESSAGE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from coral.ash.relay.mailchannels.net (coral.ash.relay.mailchannels.net [23.83.222.39]) (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 16:44:00 +0000 (UTC) X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id C0AD32C530A for ; Sun, 21 Jul 2024 16:42:26 +0000 (UTC) Received: from nl1-ss105.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id 188AA2C4BE9 for ; Sun, 21 Jul 2024 16:42:24 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1721580145; a=rsa-sha256; cv=none; b=cAv2JAKKQZN3xkxTsKICKOPA67otaoJuxuiLnx/XaJodBor9eKtTFF5Hw1N/ieDAPzm16q 5bOFO0eL8IE1ZoxGMpdaDZxLZ3HMWVXD1dgh3e5/le1PAb8NqxWS/PVhN+/Ax2oACZefx7 PjNBV0j8w6hisKoonT2REDNvQoIHpI5dCKOJyPOcVB0pUPcmK9SsJcUGBbOqg+/TyORhAo HQ22ky6EiRH7t74HiaRCBhRyJUP0fARsMtzy+AFp2S5ir+p2TKPxBKnMwpGGH/1TPmc6DZ 8FN+d1cElN0+Tn1og5xbW7+czJC+PaiFSXeHP6rO5CiPsDEMjlapIIgs9vI7oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1721580145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=i56wFoirAQA0o/6xm+T9oE/q370zaV2x7/Rk8Hs0mB0=; b=Nx1AExCrXmLUvPWQTyHJAgRDWExkspg0DOjPdrds7sW2wbYtZ/8o5INl5GRJbgPQzPYaXa trXESmW2pYyqW1inN6hyWkAzVZLBMtwEpu1QDN/5wWtt/gLeh0fh4mENmn/qA0GRTgoVIJ awtdcwMFveSEFAhPG0um6T6wG5ujcEDyT8hXf3qxkOqAEwN2yqAZ7mKJf43ru2X1ajeHZG hAQ9IHr23HjKTv+myZJkKte/2xWeBad17ZHBwgHArIRBZqVq8aPl/CO+CDQSSTZWsGv8Du GzbQAQbz9dpGbWcNQif7UnFPlWVojgRLWAg2J2j4oxouLbXhsf3kkhHf+aBkXA== ARC-Authentication-Results: i=1; rspamd-5d9c874f6d-h74vx; auth=pass smtp.auth=a2hosting smtp.mailfrom=php-internals_nospam@adviesenzo.nl X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|juliette@adviesenzo.nl X-MailChannels-Auth-Id: a2hosting X-Fumbling-Hook: 6882ca4867b17b61_1721580145631_3483416591 X-MC-Loop-Signature: 1721580145631:3558142925 X-MC-Ingress-Time: 1721580145630 Received: from nl1-ss105.a2hosting.com (nl1-ss105.a2hosting.com [85.187.142.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.121.241.7 (trex/7.0.2); Sun, 21 Jul 2024 16:42:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=adviesenzo.nl; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=i56wFoirAQA0o/6xm+T9oE/q370zaV2x7/Rk8Hs0mB0=; b=n/UX8tDoZ/L01P7qFuGzYJ4+oQ JjPsAklyCs6rPvfp4ifiK9VdHKjUOwnrW1KyiRnMmX+7ZwM/sQ23Jd8aosM+ndlH0wKXto0k+zjdZ vbLeC2xGMdURTExDVQYbk7QYIbKGcrRYsHkd1Asu1Qifm4A7PQtOTjR/6weIHFqvE09w=; Received: from mailnull by nl1-ss105.a2hosting.com with spam-scanner (Exim 4.97.1) (envelope-from ) id 1sVZdf-0000000A4F8-0vKB for internals@lists.php.net; Sun, 21 Jul 2024 18:42:23 +0200 X-ImunifyEmail-Filter-Info: UkNWRF9WSUFfU01UUF9BVVRIIFJDVkRfVExTX0FMTCBWRVJJ TE9DS19 DQiBSQ1ZEX0NPVU5UX09ORSBCQVlFU19IQU0gTUlNRV9VTktOT1dOIE FSQ19OQSBNSURfUkhTX01BVENIX0ZST00gSUVfVkxfUEJMX0FDQ09VT lRfMDUgTUlNRV9UUkFDRSBGUk9NX0VRX0VOVkZST00gRlJPTV9IQVNf RE4gVE9fRE5fTk9ORSBSQ1BUX0NPVU5UX09ORSBJRV9WTF9QQkxfQUN DT1VOVF8wMSBUT19NQVRDSF9FTlZSQ1BUX0FMTCBfRFJVR1NfTU1fRE lTQ09VTlQgQVNO X-ImunifyEmail-Filter-Action: no action X-ImunifyEmail-Filter-Score: 0.33 X-ImunifyEmail-Filter-Version: 3.5.16/202407201230 Received: from [31.201.40.213] (port=50363 helo=[192.168.1.16]) by nl1-ss105.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.97.1) (envelope-from ) id 1sVZdf-0000000A4Er-0Kww for internals@lists.php.net; Sun, 21 Jul 2024 18:42:23 +0200 Subject: Re: [PHP-DEV] Request for opinions: bug vs feature - change intokenization of yield from To: internals@lists.php.net References: <66984FD0.5090805@adviesenzo.nl> <6699F817.8070806@adviesenzo.nl> <9571bb82-9873-4319-9bd1-0361748335be@bastelstu.be> <669BDB00.70507@adviesenzo.nl> <669BE870.2050908@adviesenzo.nl> Message-ID: <669D3A65.8020603@adviesenzo.nl> Date: Sun, 21 Jul 2024 18:42:13 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------000906060505030007080509" X-AuthUser: juliette@adviesenzo.nl From: php-internals_nospam@adviesenzo.nl (Juliette Reinders Folmer) This is a multi-part message in MIME format. --------------000906060505030007080509 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 21-7-2024 13:28, Ilija Tovilo wrote: Hi Ilja, > > I agree that it's not very likely that many people started placing > comments between yield and from, but certainly not impossible. The > main problem with reverting this change is that such code will > completely stop working. Patch updates are routinely installed on > servers without additional testing, so it's very much possible that we > would brick peoples production environments. That can be said about any bug fix though. The space bar heating anecdote comes to mind. > To compare the impact on PHP_CodeSniffer: From what I understand > (please correct me if I'm wrong), there are really only two possible > scenarios when encountering comments between yield and from: > > * PHP_CodeSniffer doesn't see the comment and acts as if it weren't > there, and potentially removes it when fixing errors automatically. > * PHP_CodeSniffer thinks this is a syntax error and thus reports it. Actually, the impact is a bit larger than that (false positives/negatives for indentation checks, annotations being ignored, comments not being checked etc), but that's a different discussion. The more problematic impact is that this undocumented change in tokenization can currently cause the autofixer of PHPCS to **create** parse errors in code. > While that's not optimal, it is limited to a subset of the already > small set of people using this new feature, namely the ones also using > PHP_CodeSniffer. It is also limited to development environments, where > PHP_CodeSniffer is executed. While I understand the interest in minimizing the impact, there are millions of people using PHP_CodeSniffer every day. > In the likely case of not finding consensus on this issue: Setting up > a vote doesn't seem straight-forward to me either. Would we consider > 8.3 the baseline, with reverting the change requiring the 2/3 > majority, or do we consider 8.2 the baseline? For a potential vote, I would think more along the lines of consistency rules, i.e. "what is allowed in a token" (whitespace, new lines, comments) ? And then, depending on the proposal, what tokens would be impacted if this is changed (namespaced names, cast tokens, heredoc/nowdoc openers, yield from) and how will this impact these tokens ? Smile, Juliette --------------000906060505030007080509 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
On 21-7-2024 13:28, Ilija Tovilo wrote:

Hi Ilja,


I agree that it's not very likely that many people started placing
comments between yield and from, but certainly not impossible. The
main problem with reverting this change is that such code will
completely stop working. Patch updates are routinely installed on
servers without additional testing, so it's very much possible that we
would brick peoples production environments.
That can be said about any bug fix though. The space bar heating anecdote comes to mind.

To compare the impact on PHP_CodeSniffer: From what I understand
(please correct me if I'm wrong), there are really only two possible
scenarios when encountering comments between yield and from:

* PHP_CodeSniffer doesn't see the comment and acts as if it weren't
there, and potentially removes it when fixing errors automatically.
* PHP_CodeSniffer thinks this is a syntax error and thus reports it.

Actually, the impact is a bit larger than that (false positives/negatives for indentation checks, annotations being ignored, comments not being checked etc), but that's a different discussion.

The more problematic impact is that this undocumented change in tokenization can currently cause the autofixer of PHPCS to **create** parse errors in code.

While that's not optimal, it is limited to a subset of the already
small set of people using this new feature, namely the ones also using
PHP_CodeSniffer. It is also limited to development environments, where
PHP_CodeSniffer is executed.

While I understand the interest in minimizing the impact, there are millions of people using PHP_CodeSniffer every day.

In the likely case of not finding consensus on this issue: Setting up
a vote doesn't seem straight-forward to me either. Would we consider
8.3 the baseline, with reverting the change requiring the 2/3
majority, or do we consider 8.2 the baseline?

For a potential vote, I would think more along the lines of consistency rules, i.e. "what is allowed in a token" (whitespace, new lines, comments) ? And then, depending on the proposal, what tokens would be impacted if this is changed (namespaced names, cast tokens, heredoc/nowdoc openers, yield from) and how will this impact these tokens ?

Smile,
Juliette
--------------000906060505030007080509--