-
Notifications
You must be signed in to change notification settings - Fork 7.9k
RFC: Pipe operator #17118
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
RFC: Pipe operator #17118
Conversation
2f0e83c
to
0f8b8b5
Compare
Oh, nice. You're implementing your own RFCs now? 👍🏻 |
Well, with help. :-) |
e98f4df
to
2beea97
Compare
If this comes to integrate it would be one of the first to try it, it looks super good |
Once php/php-src#17118 is merged, we can create a PHP 8.5 emitter which does not include it and emits pipes natively
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the optimization Tim mentioned could be added, that would be nice. But LGTM otherwise.
callable_ast->child[0], callable_ast->child[1], arg_list_ast); | ||
/* Turn $foo |> $expr into ($expr)($foo) */ | ||
} else { | ||
zend_compile_expr(&callable_result, callable_ast); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check Derick's request for ZEND_EXT_STMT
? It looks like their currently only emitted after statements, more or less. So, I don't think anything is needed but it would be good if you verified with him.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding from the discussion in Slack was that the current code should be sufficient. I'm not sure how to verify. @derickr, please advise (or verify).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absent any other feedback, I am pretty sure that even in the worst case Xdebug would catch the start/end of the function call anyway, just like it would if you nested functions. I think it's fine to leave as is for now; if it causes a problem for Xdebug during beta testing, that seems like a reasonable thing to fix at that time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of the 80-col wrapping as it's archaic and makes code hard to read, but that doesn't block this PR. I don't see an obvious issue
cf: https://wiki.php.net/rfc/pipe-operator-v3
Vote has been approved, code seems clean, it should be mergable as soon as CI is happy.