Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124533 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 A8C191ADB45 for ; Sun, 21 Jul 2024 11:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721561435; bh=nbYU+iorfpvOTahSPaqMKA3X9R8vm7W5XEySj3RgUok=; h=Date:Subject:To:References:From:In-Reply-To:From; b=fzWnFmpDLm+LPT2P4iM27iYAaRzKxqQIuTL7yxeGXhX7efNA/CBCYumueIsnbhfL9 nrwbkbwvU8zyjzYyJRCpm5NPUaPR7Fz+a/NSg/sxBdYbkie1BhwdtGUHvZTQHABnvM bjnEIQLjINX0kg6Lk+JcU6LvWvu4h0dw8EzaeC+IIk3G1et6i0tbsYYuMtPTwhSdRw CcxA+TEAlghW5I1kg0KnYuNB47OW3vqVoz2EIhQtDaJCY4asH4yGsdGSbtNKsY9EFu kSPASh+7Qk4/uaLare9AoQCtqb2byQsAMNfBaO8S+eyyOEf4qbfn+QZJKmmee+EkRH DmWLPg0kMPfPg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0491418003F for ; Sun, 21 Jul 2024 11:30:34 +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 ; Sun, 21 Jul 2024 11:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1721561338; bh=6RwilJNq7awnLgFWu95U6afVpisMV5TjNQPtwuCDnpc=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=emfx0wEFASBZAlrnxBDhscJkLnIF1zpeKt/h89Y2FJCMqIuT99ANxttOI//OJWiNo ltH3oOkhJBMZ3uJaBotTAHD8Zj9ED5eB4xv0PLL9LjmH6NdNHDuuBhWGrF8HhUw7/v zuXMQZnXg0UO8UAqFtLJWld4izyGhN9lyCAjX+6hqNrkBcByl84ZUR9W4TeJu3X3Ju BPXI1xggdrSuCAoL07mBxdZ3YgSnZgnsXIUFKFnNPD7fKLVa371g6EWfWEL9ZrVkd0 A4CQaqcKV+8Pp2i9a3QEhP0sneecTmwtiWlg4aU3xwhszeqfmV0ZKARjoQPWtSqTCT kXpEnsYD5kX2A== Message-ID: Date: Sun, 21 Jul 2024 13:28:57 +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 - changeintokenization of yield from To: "Christoph M. Becker" , Juliette Reinders Folmer , 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> Content-Language: en-US In-Reply-To: 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/20/24 20:31, Christoph M. Becker wrote: > If the tokenizer would tokenize a whole file as a single token, would > that also be correct? Of course, I'm exaggerating, but The function is documented as: > token_get_all() parses the given code string into PHP language tokens using the Zend engine's lexical scanner. So if Zend engine's lexical scanner would tokenize a complete PHP file as a single token, then the output would be correct, yes. > doesn't look correct to me – "yield /* comment > */ from" shouldn't be a single token. > Looking at this from a user expectation perspective and not a technical perspective, neither should `yield from` be a single token in: var_dump(token_get_all('