Re: Request for opinions: bug vs feature - change intokenization of yield from
| From: | Christoph M. Becker | Date: | Thu, 18 Jul 2024 22:51:47 +0000 |
| Subject: | Re: Request for opinions: bug vs feature - change intokenization of yield from | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-124501@lists.php.net to get a copy of this message | ||
Hi Bob!
On 18.07.2024 at 15:41, Bob Weinand wrote:
> Moreover, it can - at least - be worked around in tooling by special casing the T_YIELD_FROM
> token and extracting the comment from the raw parsed string:
>
> var_dump(token_get_all('<?php yield /* comment */ from $foo;'));
>
> will contain:
>
> [1]=> array(3) { [0]=> int(270) [1]=> string(24) "yield /* comment */ from"
> [2]=> int(1) }
>
> It's not optimal, but probably the least bad solution to leave it unchanged in PHP 8.3,
> have tooling special case it and properly fix it in PHP 8.4.
And what about "code" like <https://3v4l.org/4CLhM>? Is Codesniffer
supposed to scan the result of <https://3v4l.org/dKDcs>
for possible CS
violations?
Cheers,
Christoph