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

[email protected] (Tim Düsterhus) Mon, 20 Jul 2026 14:34:24 +0200
Newsgroups php.internals
Message-ID <[email protected]>
Hi

On 2026-07-19 10:35, Nick Sdot wrote:
> I think the latter would be more intuitive: assign the result of piping 
> to the variable. I know that `|>=` follows the established `foo=` 
> convention for compound assignments like `??=` or `.=`; which is an 
> argument in its favour. Still, I think `=|>` better communicates how 
> this particular operation expands. Especially when considering future 
> additions like the ones Vadim proposes in future scope.

I believe language consistency is of utmost importance for users to 
learn and remember fewer special cases.

> One additional soft argument is that text ligatures will show >= as ≥ 
> which will just add to the confusion if modifying operators as Vadim 
> proposes in future scope would ever be added.

It's also not uncommon for them to show |> as ▷, because |> is 
established as a pipe operator.

> Long story short: `=|>`over `|>=` IMO has a lot of appeal.

I disagree. It looks more like a special form of `=>` rather than an 
assignment, which loops back to the “consistency” argument above.

Best regards
Tim Düsterhus