Skip to content

Use indexAccess operator for php field access calls with arbitrary expressions #5601

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

Merged
merged 3 commits into from
Jul 22, 2025

Conversation

johannescoetzee
Copy link
Contributor

This PR changes the representation for php property accesses with arbitrary expressions on the RHS, for example:

$obj->{foo()}

Previously, these were represented as field access calls, but this causes a crash in the back-end since it breaks the assumption that a field access calls have an identifier or field identifier as the second argument. Instead, these are now represented as index access calls, per the suggestion from @maltek

@johannescoetzee johannescoetzee merged commit d8d22dc into master Jul 22, 2025
8 checks passed
@johannescoetzee johannescoetzee deleted the johannes/php-index-access branch July 22, 2025 11:34
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.

2 participants