Re: [RFC] Pipe Assignment Operator

From: Date: Mon, 20 Jul 2026 12:34:24 +0000
Subject: Re: [RFC] Pipe Assignment Operator
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-132048@lists.php.net to get a copy of this message
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

« previous php.internals (#132048) next »