Skip to content

feat: asymmetric visibility support (PHP 8.4+)#1219

Draft
jorgsowa wants to merge 4 commits intomainfrom
feat/asymmetric-visibility-syntax
Draft

feat: asymmetric visibility support (PHP 8.4+)#1219
jorgsowa wants to merge 4 commits intomainfrom
feat/asymmetric-visibility-syntax

Conversation

@jorgsowa
Copy link
Collaborator

Supersedes #1148

Add parsing support for PHP 8.4 asymmetric visibility modifiers on class properties and constructor promotion parameters.

  • Parse public private(set), protected private(set), private(set), protected(set) modifiers in class body
  • Parse asymmetric visibility on constructor promoted parameters via read_promoted in function.js
  • Add visibilitySet field to Declaration and PropertyStatement AST nodes
  • Add flagsSet field to Parameter AST node

jorgsowa and others added 4 commits March 19, 2026 23:52
Add parsing support for PHP 8.4 asymmetric visibility modifiers on class
properties and constructor promotion parameters.

- Parse `public private(set)`, `protected private(set)`, `private(set)`,
  `protected(set)` modifiers in class body via `read_member_flags`
- Parse asymmetric visibility on constructor promoted parameters via
  `read_promoted` in function.js
- Add `visibilitySet` field to `Declaration` and `PropertyStatement` AST nodes
- Add `flagsSet` field to `Parameter` AST node
- Update `types.d.ts` with new fields
- All (set) parsing is gated behind `version >= 804`

Co-authored-by: Thomas Genin <664857+genintho@users.noreply.github.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.

1 participant