Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124514 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 0F9581A0120 for ; Sat, 20 Jul 2024 14:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721487190; bh=IIG+wl97rG/YDBJT0PJIBKvCZLLMLYcwfEuJwOE3IVo=; h=Date:Subject:To:References:From:In-Reply-To:From; b=N7l+Xonst+LD1w2xA3iMqrsjdhrG2EDb4U1l4fj9iL8nKkkzduTEv4o0VOTe+BdfO vKL1m7q2SezARxdyJC6ApVuu/KV/1edq7R+6VAxztwr8cEjrbmZdaviA83Mv4wzZWp V1wlmGpa9UfoxEXLkQJnmMVxfwnNsRHXk/IGyhu+24rC3L5k7ZiooGL0d/guWqkuWn wa2AjHxKBOtp9Xf6+WAWogSQDB0x0gbdXj8/5GcTCr6aAUWLO1FB/RAHKi+oOsr/Fi Np3guZ3OwF0xxNS+WBnQUdW4vHYLflys5mHWZb2Yv04QmPU2aC6GWt1520/7THWRvn GdL4R7tSBzQCg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B1CF21801D6 for ; Sat, 20 Jul 2024 14:53:08 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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 14:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1721487092; bh=HzW55Ejef5Af2Yh6ElxOjXYmN0+Ei7M3o4Nh31T98wM=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=ej5Ngxfj1pHURKo77brYH61S8c87RRx+eb3E6NAUOLHIzcN/2/+sKAIsQklsi9HZQ S19i1DU4KMgDBb3juj8LJk3NO9jb9fqLc4/qZCaKf055Z3AJGe7dZ7Hp2Bvms3Jnfc yb+6DhA1s7k/7NS+j2PsAmr4Qu/v8TXOImETHd9kX4/NX3NOrqgjbOQkkAQL6y1vB1 m3Q59VzO0zTEDv5sHULs5WP73HDWV4nswsxODv9UCx1Q0GsX9PUUR/nub347cYkQOB JDnM1+A9Q+RmFy7bTqeMkCQ05YQoiQddFoFjUpWpxCW21qhgf53WLtvCOR0u5v5kQJ KkuH75u/uzt1g== Message-ID: <9571bb82-9873-4319-9bd1-0361748335be@bastelstu.be> Date: Sat, 20 Jul 2024 16:51:30 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] Request for opinions: bug vs feature - change intokenization of yield from To: Juliette Reinders Folmer , internals@lists.php.net References: <66984FD0.5090805@adviesenzo.nl> <6699F817.8070806@adviesenzo.nl> Content-Language: en-US In-Reply-To: <6699F817.8070806@adviesenzo.nl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 7/19/24 07:22, Juliette Reinders Folmer wrote: > More than anything, I find it concerning that this change sets a > precedent for tokens to include comments. > > Just as an example: what does this mean for the PHP 8.0 nullsafe object > operator ? Should we now suddenly allow that to be written as `? > /*comment*/ ->` ? > Or what about a cast token ? Should that be allowed to be `(string /*for > reasons*/)` ? The difference between `yield from` and `?->` is that the former looks and feels like it would be two separate keywords, because of the *required* whitespace between the `yield` and the `from`. The fact that a `yield` keyword actually exists also contributes to that. `?->` on the other hand looks and feels like a single operator, just like `++`, `!==`, `<=>` and others. Except for `yield from` the rule where comments may be placed as far as I can tell is "comments may appear where whitespace may appear", which is easy enough to explain and understand. So it makes sense to allow for comments between `yield` and `from`, but I agree that ideally those would be emitted as separate tokens. Best regards Tim Düsterhus