Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Handle the ::class static keyword as a special case in parser/variable.js #1138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mreiden wants to merge 1 commit into glayzzle:main
base: main
Choose a base branch
Loading
from mreiden:issue-1135

Conversation

@mreiden
Copy link
Contributor

@mreiden mreiden commented Aug 14, 2024

Handle T_Class as a special case when it comes after T_DOUBLE_COLON in recursive_variable_chain_scan

This solves #1135

$arrayVariable[0]::class;
$classVariable->classProp::class

ichiriac reacted with thumbs up emoji ichiriac reacted with heart emoji
Copy link
Member

@ichiriac ichiriac left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue comes from the way PHP understands identifier https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L325

From a certain version, identifiers are composed also by reserved and semi reserved keywords :
https://github.com/glayzzle/php-parser/blob/main/src/parser/variable.js#L161

Here an example on how it's handled from php 7.0 :

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ichiriac ichiriac ichiriac requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /