Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124519 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 946E01A00B7 for ; Sat, 20 Jul 2024 16:40:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721493722; bh=QSxM+kCIbQaRHPjzrQEQtbsoj8Ky7tmwGhXqXQVrmm8=; h=Subject:To:References:From:Date:In-Reply-To:From; b=RwL2i6WVy15x+2DUkkzeCobpOVPKQbjEQV/UzKOYtyPfaomgiPBxcaipmVPNB+pyO dRcVAdIMDOgwGwM4N6QvRxlDVhlvxkIHj1TLDNqLnJj0BaYNOAXPczFVoYtwtDlGV0 IklimjkVOfU5Eb9TnLG2njdW6hFaRPTLGQuy26hYVC2PoR+JsmpR0fAwjnW07je8Dx LgJXxeh+ladPpYoRbazT/KeXNYyMaSIwadMbELjimkxxQFxkSPBM/2/xdA5jtMWAOV 4tw5vMYh8KI75Ew7tQTZZV0eBvOzQMVVhKtqt21uBCZxoyk2ruEQvEqgqFcmU37NWf 1k87y/oJl1HQw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8B788180039 for ; Sat, 20 Jul 2024 16:42: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=1.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_20, 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 zebra.cherry.relay.mailchannels.net (zebra.cherry.relay.mailchannels.net [23.83.223.195]) (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 ; Sat, 20 Jul 2024 16:42: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 1F15990270E for ; Sat, 20 Jul 2024 16:40:28 +0000 (UTC) Received: from nl1-ss105.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id 17639903DA2 for ; Sat, 20 Jul 2024 16:40:26 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1721493627; a=rsa-sha256; cv=none; b=g1josErx0pTZ3uQ1EnuIJpPEnFDO50ufcHsVSwOuEVYFCSGpWKvJlsMlVt9kFDbzuCRM2b 5kCsx/t+9qnruLES7qggMc/rJ6vXRUHj9dlcGIZn5tfuw3/HqkmUxfyInvmbLsg7zCh+hp kaN1L+mpdHeTn7pUzIhMFQEofV5QlSl+fJkdElFk0Hw6mDzHxywM+9mHoF21vEuSgl7q6U 6UfDAjktaGEWdUVjr8cHylUdFjZIj6ExenqMzjxBxY+hAvJ0/QHotf6Z70Lz//Iegb7pth 3qlQ/xEdQ0wll1i6RaNjhUuIrAt7UR4Lhw7hG3P7BNKfA0LLVt9Ozw72Z1mzhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1721493627; 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=QzfIduBYCnS6SmGxBsapnLVHPMYYskTbWAD4g0gnOBs=; b=bWlqOCJ7F52Yr0HAAFI8UripxVzoy3vPAm/+JZvgMpx516ZFBovl4UQFxrc8yq/NG7gNkm 9H5pTaO/GY2CDcDpVQh4A+0RwDFZOQMaLM8/yRvCBzz/Wqx4MwrlSFZdO9jAK4eWQTANHC jA62sWiheTzI5/ibr82y1JJNekNsOT7rXsG9LxcfbucUqJpxFcSU1aFvwxZdO09TuRVZsM t0UkQMlR7IxHlJvIadghZrUxZL9C4F8JzEKJXVNe7SLEBhgk9QqfsSQMPVbh4Ku0Ph4Zqy v3qJJxR1LqIdBpnJEvzRZ38grXgeEcZWgOePwifw/ux5x7STe1HFEE2TQ8iDuQ== ARC-Authentication-Results: i=1; rspamd-585d4c99d7-4pxxl; 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-Scare-Wiry: 5e2c322f2ec6858e_1721493627620_471271298 X-MC-Loop-Signature: 1721493627620:992384195 X-MC-Ingress-Time: 1721493627620 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.115.121.62 (trex/7.0.2); Sat, 20 Jul 2024 16:40:27 +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=QzfIduBYCnS6SmGxBsapnLVHPMYYskTbWAD4g0gnOBs=; b=SPkLszjgqyyBOe8b4vD816kPBQ 3uX/R3E2JYmepjc2DSWUCUyDFIqsAd6tnlALb3caIUF6yfIDN1Wj2zu2nrwHXFGuXWpR9Dmdtoe4B YD2YznFPDrei7q0mJqilgGbzxYsMHs9mmUm99jBueqKpWwYMPtW7BUFJ3Ra89Oi7l/hA=; Received: from mailnull by nl1-ss105.a2hosting.com with spam-scanner (Exim 4.97.1) (envelope-from ) id 1sVD8D-0000000Fdln-0mH4 for internals@lists.php.net; Sat, 20 Jul 2024 18:40:25 +0200 X-ImunifyEmail-Filter-Info: UkNWRF9WSUFfU01UUF9BVVRIIFJDVkRfVExTX0FMTCBWRVJJ TE9DS19 DQiBSQ1ZEX0NPVU5UX09ORSBCQVlFU19IQU0gQVJDX05BIE1JTUVfVU 5LTk9XTiBNSURfUkhTX01BVENIX0ZST00gSUVfVkxfUEJMX0FDQ09VT lRfMDUgTUlNRV9UUkFDRSBGUk9NX0hBU19ETiBUT19ETl9OT05FIFJD UFRfQ09VTlRfT05FIElFX1ZMX1BCTF9BQ0NPVU5UXzAxIFRPX01BVEN IX0VOVlJDUFRfQUxMIEZST01fRVFfRU5WRlJPTSBBU04= 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=51225 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 1sVD8H-0000000FdlP-0oCO for internals@lists.php.net; Sat, 20 Jul 2024 18:40:25 +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> Message-ID: <669BE870.2050908@adviesenzo.nl> Date: Sat, 20 Jul 2024 18:40:16 +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="------------050401090105090004020902" X-AuthUser: juliette@adviesenzo.nl From: php-internals_nospam@adviesenzo.nl (Juliette Reinders Folmer) This is a multi-part message in MIME format. --------------050401090105090004020902 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 20-7-2024 18:04, Tim Düsterhus wrote: > PHP users have no idea what a token is internally. I'm looking at this > from a PHP user perspective. It looks like two keywords, it walks like > two keywords and it quacks like two keywords. I find it reasonable for > users to consider this as two keywords and not care about how it's > implemented internally. > >> So, what "feels" natural (whitespace-wise) to one person may not be the >> same for the next, but comments _within_ tokens is different thing and >> should in my opinion, not be allowed. > > As I've said: I agree that the current situation is unfortunate. But > the correct solution is not "disallow comments", but "split the > T_YIELD_FROM into T_YIELD T_WHITESPACE T_FROM_FOR_YIELD_FROM". > Tim, you're making my point for me. This is *exactly* why the current change should be reverted. I'm not against changing the tokenization of "yield from" and the GH ticket thread also contains an alternative proposal for this from Bob [1], but like Matthew also said [2]: if that's something we want to do, let's have a proper discussion about it and let it go through an RFC and be a documented change. And not, like it is now, an undocumented, random change creating an inconsistency in the Tokenizer. Smile, Juliette 1: https://github.com/php/php-src/issues/14926#issuecomment-2228855422 2: https://externals.io/message/124462#124515 --------------050401090105090004020902 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 20-7-2024 18:04, Tim Düsterhus wrote:
PHP users have no idea what a token is internally. I'm looking at this from a PHP user perspective. It looks like two keywords, it walks like two keywords and it quacks like two keywords. I find it reasonable for users to consider this as two keywords and not care about how it's implemented internally.

So, what "feels" natural (whitespace-wise) to one person may not be the
same for the next, but comments _within_ tokens is different thing and
should in my opinion, not be allowed.

As I've said: I agree that the current situation is unfortunate. But the correct solution is not "disallow comments", but "split the T_YIELD_FROM into T_YIELD T_WHITESPACE T_FROM_FOR_YIELD_FROM".


Tim, you're making my point for me. This is *exactly* why the current change should be reverted.

I'm not against changing the tokenization of "yield from" and the GH ticket thread also contains an alternative proposal for this from Bob [1], but like Matthew also said [2]: if that's something we want to do, let's have a proper discussion about it and let it go through an RFC and be a documented change.

And not, like it is now, an undocumented, random change creating an inconsistency in the Tokenizer.

Smile,
Juliette

1: https://github.com/php/php-src/issues/14926#issuecomment-2228855422
2: https://externals.io/message/124462#124515


--------------050401090105090004020902--