[RFC] Pipe Assignment Operator
The RFC proposes a compound assignment form of the pipe operator: $x |>= callable becomes shorthand for $x = $x |> callable.
Chaining is supported. An implementation including tests has been submitted as a pull request against php-src, and discussion is open on the internals list.
Caleb White has introduced a new RFC to implement a pipe assignment operator in PHP. The proposal introduces the |>= operator, which serves as a compound assignment shorthand for piping a value through a callable and assigning the result back to the same variable.
This new syntax allows for the chaining of multiple operations. To support the proposal, a pull request (PR #22633) has been submitted to the php-src repository, which includes the necessary implementation and a suite of tests.
Following the announcement on the internals mailing list, Tim Düsterhus noted a missing "Abstain" option in the RFC's voting widget, which has since been corrected to align with current PHP RFC templates.
Readers’ Forum
No contributions yet — open the debate.
Open the discussion
No account or password needed — just enter your e-mail and we’ll send you a one-time sign-in link. First time here? You’re set up automatically.
Your rating will be applied automatically after you sign in.
Check your inbox
We’ve sent a sign-in link to …. Open it on this device — this tab will sign you in automatically.
Waiting for your click …
·