Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124532 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 983671A00D2 for ; Sun, 21 Jul 2024 11:28:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721561422; bh=aa1HN2iPnhWoIJSlXHr7sC4nVEU70rhScTnjVPquIBQ=; h=References:In-Reply-To:From:Date:Subject:To:From; b=FX+pXtEeWvwA8igmWxQarnFTOTgq9U4TdP/pHM21AxtL92wGumtG34Dx/dgz7JlJo 3VfHQD6eosl5bgwUigDW9bWSJGDiwy2uM8poS4AnFOfoKiL+YyKB0IZnOdknraTDpo GuN9zTBhrN1ixRYLEe7sHG2WB5Fgj96l8nmGlsP4G+UEPiFyVsri01Ru/Z9pHc4h2C Q9HMeaStX23r2nfeDZQK2InRuWiA8kmGkh6oG9n1qgeae2c/hOa9uPTaJG6V9qDzfK PLeMYDC3dlkO55L38cG3bPLFHnkcDJQqtJdGILB4MDXJLPWzhCs//Uvr61ORFVJeUJ m6V2tt+uYthFQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E51BB18037E for ; Sun, 21 Jul 2024 11:30:20 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (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 11:30:18 +0000 (UTC) Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-6b79c27dd01so20867986d6.3 for ; Sun, 21 Jul 2024 04:28:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721561325; x=1722166125; darn=lists.php.net; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aa1HN2iPnhWoIJSlXHr7sC4nVEU70rhScTnjVPquIBQ=; b=eN3GF3mcdTm7KnzFGi0iCZ7X2bmT/edYJi6RM3VTMBoZlQKWRIM/v5gHurZBoAxUok Vy0DKx0qPOO1YAWyXn0xriy/y6mHche5nfXPiuRGWU/s1jZigAhk/thzvSPvUj02D4KM h9Uefqdu6E4j/LHVltmpic7EQIIk7XQMl8PTfge16UMy6lJp8XiCb9dXpUg/WoKjvli0 /2r4Ecifl1we5hne4LZd3dew01g5C0h8A/zzG7q4R0RYVItFIDLdTRBhcxpQ5LUOzKOp xsXQYicv8YcqriMYT3m4ds/UdGsmx0/U+BfuC/XLYkCeGHDbQSP7hFQB7dEB/F4IDe5R pcjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721561325; x=1722166125; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aa1HN2iPnhWoIJSlXHr7sC4nVEU70rhScTnjVPquIBQ=; b=X1why3soPXywKIzBN4U4wV1RG2R0YfI12eTZnIqzIcqmKmGBne//Z0kUXW5isviweJ o4WgnQnFRFwaFIAGJ/Vmg1E1JOlvj9n96iw5JMV2NExe91vIDCId/zN5N+UPXcgm7peL AX6JRjiDG/Whzr99aWYDTzFSdzj3yxdhn2x9mM6BN+cE5uigiEsbtkpXKSECeNlGVrnj P/iwHj/v25GOxNkr6lkBTCF4rBCbViRsZgDRHB0NtUtNFmJLqJE1r7hHdwgKwTYPdFHJ tag7rWMTwFq8tWF9i339C1PJeLaW8QT00sPG8jPefvte2DvwXP0ao6V7u6NElg0lA6Mr xjrw== X-Gm-Message-State: AOJu0YyAG6pT60dNr2uBwmktZVs+UtIkvJj1wOnL802Ciiv3MIX3hWa4 bad9KAADUY8irAREl9Pke9fDvmeXjv+Qdn/wInh3r0ryebn1znM9KNV+a53sA98lH2FKzAANsZd 1IgeUIR9Keeduk0ARciSQ3n3Yiw6tmG1yBsI= X-Google-Smtp-Source: AGHT+IEF7ByhvXbghEUEW3AgLIX9z7nKE6j8tZJF7YIzrhzHCIACyhePCxEWu3nOyWY2U2fKjZU7hbFhiUiO/etY9FY= X-Received: by 2002:a05:6214:19c7:b0:6b0:76f1:8639 with SMTP id 6a1803df08f44-6b95a6e96a8mr72862946d6.42.1721561325566; Sun, 21 Jul 2024 04:28:45 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <66984FD0.5090805@adviesenzo.nl> <6699F817.8070806@adviesenzo.nl> <9571bb82-9873-4319-9bd1-0361748335be@bastelstu.be> <669BDB00.70507@adviesenzo.nl> <669BE870.2050908@adviesenzo.nl> In-Reply-To: <669BE870.2050908@adviesenzo.nl> Date: Sun, 21 Jul 2024 13:28:34 +0200 Message-ID: Subject: Re: [PHP-DEV] Request for opinions: bug vs feature - change intokenization of yield from To: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi Juliette On Sat, Jul 20, 2024 at 6:40=E2=80=AFPM Juliette Reinders Folmer wrote: > > On 20-7-2024 18:04, Tim D=C3=BCsterhus wrote: > > 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 in= to T_YIELD T_WHITESPACE T_FROM_FOR_YIELD_FROM". > > Tim, you're making my point for me. This is *exactly* why the current cha= nge should be reverted. > > I'm not against changing the tokenization of "yield from" and the GH tick= et 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 documente= d change. > > And not, like it is now, an undocumented, random change creating an incon= sistency in the Tokenizer. Thank you for raising this issue. Let me share my viewpoint as the person who has made the change. First of all, while allowing comments between yield and from was obviously intentional, the side-effect of embedding the comment in the yield_from token was something I did not sufficiently consider. That's my bad. 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. 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. 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. What I'd suggest instead is fixing this for master in a way that makes it simple for PHP_CodeSniffer to add support, or to just revert it there. If it is indeed true that nobody uses this feature after 8 months, then waiting another 4 for a proper fix doesn't seem like an issue. 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? Ilija