Bison parser generates different zendtokentype constants for each patch version since php 8.3.
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
Hi, I noticed that since PHP 8.3 the value of T_* constants changes for each patch version. For example, if I'll use token_get_all and cache or serialize returning result I can got unexpected behavior.
<?php
$text = <<<TXT
<?php
namespace AAA;
require_once '/tmp/dev2/t4.php';
class AAA {
}
\$class = new AAA();
TXT;
$tokens = token_get_all($text);
foreach ($tokens as $token) {
echo json_encode($token) . "\n";
}
For example
T_STRING constant is 313 for 8.3.0, 8.3.2, 8.3.4, 8.3.7, 8.3.9 versions.
T_STRING constant is 262 for 8.3.1, 8.3.3, 8.3.5 - 8.3.6, 8.3.8 versions.
However for 8.1, 8.2 there are not changes between php patch versions.
PHP Version
8.3
Operating System
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the differing T_STRING values through token_get_all across the PHP 8.3 patch versions listed in the report. Trace how the Bison parser generates the zendtokentype constants and compare the generated results across those versions; done means token constants remain stable between PHP 8.3 patch releases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100