Re: [PHP-DEV] [RFC] Pipe Assignment Operator

Vadim Dvorovenko <[email protected]> Sun, 19 Jul 2026 11:20:26 +0700
Newsgroups gmane.comp.php.devel
Message-ID <[email protected]>
Hello, Caleb.

Firtly, i’d like to point out that you aren’t the first person to come 
up with the idea of ​​combining assignment and pipeline operators, and 
inroduce `|>=` operator

Take a look at discussion, https://news-web.php.net/php.internals/128141 
. RFC draft is here 
https://github.com/vadimonus/php-rfc/blob/main/ltr-assignment.md.

I haven't submitted these drafts as an RFC yet because I haven't 
received enough positive feedback on the first RFC in the chain: 
https://wiki.php.net/rfc/pipe_to_return.  You can see another drafts in 
github.


The main idea, is that pipe operator reverses traditional funcation call 
reading order, so we need some more operators with same order to use 
together to reduce cognitive load.

Your variant of this operator makes traditional rigth to left action, 
like other action. But `|>` arrow visually defines opposite direction. 
This may lead to incorrect perception, increase cognitive load and lead 
to mistakes.


I think, all extensions of pipe operator should be ducsussed together to 
intorduce non conflicting group of operators.  Please add  to your RFC 
links to other discussions and theese RFC drafts.

10.07.2026 11:45, Caleb White пишет:
> Hi internals,
>
> I'd like to open discussion on my (first!) RFC for the pipe assignment operator (|>=):
> https://wiki.php.net/rfc/pipe_assignment_operator
>
> It adds a compound assignment form of the pipe operator, so that
> $x |>= callable is shorthand for $x = $x |> callable, with
> support for chaining. Implementation with tests is at:
> https://github.com/php/php-src/pull/22633
>
> Looking forward to your feedback.
>
> Thanks!
> Caleb

-- 
--
Vadim Dvorovenko