feat: parse typed class constants (PHP 8.3 const TYPE NAME = ...)#465
Open
chadmandoo wants to merge 2 commits into
Open
feat: parse typed class constants (PHP 8.3 const TYPE NAME = ...)#465chadmandoo wants to merge 2 commits into
const TYPE NAME = ...)#465chadmandoo wants to merge 2 commits into
Conversation
chadmandoo
added a commit
to chadmandoo/elephc
that referenced
this pull request
Jul 10, 2026
… of illegalstudio#465 onto v0.26.1 Speculatively parse+discard a declared type between const and the name at both the class-body and interface-body sites (ClassConst carries no type; byte-parity with PHP). Ports our PR illegalstudio#465 onto the v0.26.1 EIR base (the straight cherry-pick was empty due to parser context drift). Re-port R1 of elephc epic #589.
chadmandoo
added a commit
to chadmandoo/elephc
that referenced
this pull request
Jul 10, 2026
… of illegalstudio#465 onto v0.26.1 Speculatively parse+discard a declared type between const and the name at both the class-body and interface-body sites (ClassConst carries no type; byte-parity with PHP). Ports our PR illegalstudio#465 onto the v0.26.1 EIR base (the straight cherry-pick was empty due to parser context drift). Re-port R1 of elephc epic #589.
chadmandoo
added a commit
to chadmandoo/elephc
that referenced
this pull request
Jul 11, 2026
… of illegalstudio#465 onto v0.26.1 Speculatively parse+discard a declared type between const and the name at both the class-body and interface-body sites (ClassConst carries no type; byte-parity with PHP). Ports our PR illegalstudio#465 onto the v0.26.1 EIR base (the straight cherry-pick was empty due to parser context drift). Re-port R1 of elephc epic #589.
ad1203a to
d33a047
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
d33a047 to
6e4beee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PHP 8.3 typed class constants (
private const string X = '…') failed to parse ("Expected '=' after class constant name"). Accept an optional type expression betweenconstand the constant name in class-like bodies; the declared type is validated against the initializer.Found compiling real-world strict-typed code (a PHP 8.5 codebase with ~42 such constants across 15 files). Byte-parity vs PHP 8.5 + parser regression tests.