feat: add pipe assignment operator (|>=) - #22633
Conversation
2d61f14 to
b933907
Compare
NickSdot
left a comment
There was a problem hiding this comment.
Got this review myself so it caught my eye.
b933907 to
46028af
Compare
You must do it by yourself after karma points will be granted to you. FYI: your email landed in my Gmail mailbox to spam. https://news-web.php.net/php.internals/131804 |
|
No idea, honestly. Google fights with ProtonMail around this topic, and it's quite long concern. You can check 4 years old topic here: https://www.reddit.com/r/ProtonMail/comments/v26rhi/proton_mail_emails_going_to_spam/ |
46028af to
4253972
Compare
4253972 to
2db203c
Compare
2db203c to
7989848
Compare
7989848 to
ce036bc
Compare
3254f45 to
06ea36d
Compare
TimWolla
left a comment
There was a problem hiding this comment.
Apparently forgot to hit submit.
Adds the `|>=` compound assignment operator for the pipe operator, allowing `$x |>= callable` to be used as shorthand for `$x = $x |> callable`. Supports pipe chains on the RHS: `$x |>= fn1(...) |> fn2(...) |> fn3(...)` is equivalent to `$x = $x |> fn1(...) |> fn2(...) |> fn3(...)`. Implementation modeled after `??=` (ZEND_AST_ASSIGN_COALESCE), with a dedicated AST node (ZEND_AST_ASSIGN_PIPE) and compiler function that uses memoization to avoid double-evaluating complex LHS expressions. Extracts shared callable dispatch logic into zend_pipe_build_fcall() helper used by both `|>` and `|>=` compilation. All variable target types supported: simple vars, array dims, object properties, static properties.
06ea36d to
5d5f93a
Compare
Hello!
RFC: https://wiki.php.net/rfc/pipe_assignment_operator
Thanks!