Skip to content

Fix AOT PhpToken::tokenize getTokenName (#27263) - #27327

Merged
PurHur merged 3 commits into
masterfrom
agent/issue-27263-aot-phptoken-gettokenname
Aug 3, 2026
Merged

PurHur merged 3 commits into
masterfrom
agent/issue-27263-aot-phptoken-gettokenname

Conversation

@PurHur

@PurHur PurHur commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Closes Regression: AOT PhpToken::getTokenName() undefined — VM/JIT match Zend (ext/tokenizer/tokenizer.c) #27263: AOT no longer fails with Call to undefined method object::gettokenname() for PhpToken::tokenize(...)->getTokenName().
  • Registers phptoken::{__construct,tokenize,gettokenname} JIT Call proxies; literal tokenize() materializes PhpToken objects; getTokenName() uses an inline id→name select-walk (peer GetClassRuntime).
  • Adds test/repro/aot_phptoken_gettokenname.php + AOT fixture catalog entry; spine/inventory synced (6894/6894).

php-src: ext/tokenizer/tokenizer.c / tokenizer.stub.php — PhpToken OOP API.

Test plan

  • Issue repro (exact) — Zend/VM/JIT/AOT all print T_ECHO
  • vendor/bin/phpunit --filter AotRegressionFixtureCatalogTest → OK (103 tests)
  • php script/bootstrap-inventory.php --check → OK 6894/6894
  • php script/check-selfhost-spine-coverage-sync.php → OK

Not covered: new PhpToken(...) still segfaults under thin AOT (separate from tokenize path); issue done-when is tokenize+getTokenName only.

Made with Cursor

PurHur and others added 3 commits August 3, 2026 15:17
Register PhpToken JIT/AOT Call proxies and materialize tokenize() tokens
so $t[1]->getTokenName() prints T_ECHO instead of failing at compile time.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 5bb14f7 into master Aug 3, 2026
@PurHur
PurHur deleted the agent/issue-27263-aot-phptoken-gettokenname branch August 3, 2026 15:26
PurHur added a commit that referenced this pull request Aug 3, 2026
…10533) (#27334)

Honest bootstrap-gen0-refresh-argv-driver rebuild — stamps live fingerprint
308230ea… after DateTimeZone::getName / PhpToken landed past #27329 squash
(race). Functional smoke OK. No restamp-only.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: AOT PhpToken::getTokenName() undefined — VM/JIT match Zend (ext/tokenizer/tokenizer.c)

1 participant