Repository navigation
Conversation
iliaal
requested changes
Nov 9, 2026
iliaal
left a comment
Member
There was a problem hiding this comment.
zend_ast_export_var() has the same unquoted-brace problem for the other member kinds: $o->{'a b'}(), $o?->{'a b'}(), $o->{'a b'}, C::${'a b'} and ${'a b'} all still export as {a b}. Exporting the ZVAL with zend_ast_export_ex() inside the braces there would fix all of them, and the static call path would only need the __halt_compiler/public(set) checks.
Contributor
Author
|
I'm not gonna fix it on 8.4. Whole zend_ast is too buggy on 8.4 to reliable make separate fixes. This problem is partially already fixed on 8.6, so I will create separate branch to address it only for 8.6. Thank you for review |
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.
The AST export of static method calls and class constant fetches prints dynamic member names without braces, even when the bare name doesn't lex as an identifier. The exported code then fails to parse:
Three cases are affected:
__halt_compiler: T_HALT_COMPILER is the only keyword the grammar does not accept as an identifier, soC::{'__halt_compiler'}cannot be written asC::__halt_compiler.C::{'a b'}()becameC::{a b}()andC::{''}()becameC::{}().C::public( set )was exported asC::public(set), which the lexer reads as the single T_PUBLIC_SET token.These names are now exported in braces: C::{'_halt_compiler'}(), C::{'a b'}(), C::{'public'}(set). A static call named public, protected or private is always braced, because only its arguments decide whether it would lex as T*_SET, and the braced form is always valid.
Follow-up to #25221.