Skip to content

zend_ast: Add parentheses around IIFE in zend_ast_export() #18688

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 5 commits into from
May 29, 2025

Conversation

xepozz
Copy link
Contributor

@xepozz xepozz commented May 28, 2025

No description provided.

@TimWolla TimWolla changed the title fix: add parentheses to ast functions dump zend_ast: Add parentheses around IIFE in zend_ast_export() May 28, 2025
Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

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

Changes make sense to me. I would consider this a bugfix and apply to PHP 8.3?

@xepozz While there are no official commit message guidelines, using the conventional commit style is super unusual in php-src. Personally I just prefix the Subject with a short "module indicator" and thus retitled the PR.

@iluuu1994
Copy link
Member

I would personally not consider this a bug fix. The dumper has known rough edges.

@TimWolla
Copy link
Member

I would personally not consider this a bug fix.

Okay, then master it is. Unless someone beats me to it, I'll then add NEWS and merge in the next days.

@xepozz
Copy link
Contributor Author

xepozz commented May 29, 2025

@xepozz While there are no official commit message guidelines, using the conventional commit style is super unusual in php-src. Personally I just prefix the Subject with a short "module indicator" and thus retitled the PR.

should I rename the commits now or we'll squash them with PR title when merge it?

@TimWolla
Copy link
Member

should I rename the commits now or we'll squash them with PR title when merge it?

We're squash merging in php-src, so I'll make sure to adjust the commit message then. One thing I noticed while adding NEWS was that your base branch was greatly out of date. Please make sure to keep your fork up to date. Easiest done with the "Update branch" button here:

image

Co-authored-by: Dmitrii Derepko <[email protected]>
@xepozz
Copy link
Contributor Author

xepozz commented May 29, 2025

image

@TimWolla I'd suggest to enable this setting to be able update the branch in the PR

@TimWolla
Copy link
Member

I'd suggest to enable this setting to be able update the branch in the PR

This would unnecessarily run CI twice. The base branch being a little out of date is generally fine with the activity happening in php-src, but in this case it was 3 months behind. Was easy enough to merge this locally while adding the NEWS file. Just waiting for another CI pass now, though 😃

@TimWolla TimWolla merged commit fdebad0 into php:master May 29, 2025
15 of 16 checks passed
@xepozz xepozz deleted the dump-functions branch May 29, 2025 14:00
case ZEND_AST_CALL: {
zend_ast *left = ast->child[0];
if (left->kind == ZEND_AST_ARROW_FUNC || left->kind == ZEND_AST_CLOSURE) {
smart_str_appends(str, "(");
Copy link
Member

Choose a reason for hiding this comment

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

Should have used smart_str_appendc() here and below, fixing in #18703 along with a few others

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.

4 participants