Skip to content

zend_ast: Fix AST export dropping braces of dynamic class constant fetches - #25221

Closed
jorgsowa wants to merge 1 commit into
php:PHP-8.4from
jorgsowa:fix-ast-export-dynamic-class-const
Closed

jorgsowa wants to merge 1 commit into
php:PHP-8.4from
jorgsowa:fix-ast-export-dynamic-class-const

Conversation

@jorgsowa

@jorgsowa jorgsowa commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixed AST export dropping the braces of dynamic class constant fetches.

@jorgsowa jorgsowa self-assigned this Nov 5, 2026
@jorgsowa jorgsowa changed the title Fix AST export dropping braces of dynamic class constant fetches zend_ast: Fix AST export dropping braces of dynamic class constant fetches Nov 5, 2026

@iliaal iliaal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Two edge cases remain: C::{'__halt_compiler'} and C::{"\x7f"} still lose their braces and export invalid PHP. Both behave identically before this patch and can be fixed separately.

@jorgsowa

jorgsowa commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! I'm aware about C::{"\x7f"} but it's wider bug, not only for dynamic class constant fetches. I didn't want to confuse the test cases.

I need to check case with C::{'__halt_compiler'}.

@iliaal

iliaal commented Nov 5, 2026

Copy link
Copy Markdown
Member

Yeah, those can be separate follow-up PR

@jorgsowa jorgsowa closed this in 29665a6 Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants