[PHP-DEV] Re: [RFC] Pipe Assignment Operator
[email protected] (Caleb White) Tue, 14 Jul 2026 18:17:34 +0000
| Newsgroups | php.internals |
|---|---|
| Message-ID | <uSYKVBimDaIZxNv09pjdbNIbKmzCq8HWpbVdACxwMwscFhtHO56tx74iVw2YfvoA6hvmVvd14vOF4ds3PdpyE0q5X6oh8RDZ1FkmbGtyzZU=@pm.me> |
On Mon, 13 Jul 2026 15:54:36 +0000, Holly Schilling wrote:
> I won’t get to vote on this RFC, but I wanted to give my brief opinion. To be fair, my initial opinion was that I loved the symmetry of this along with `+=`, `-=`, and similar operators, but really hated how I assumed it was likely be used. I started typing up a message showing examples of how it could be used, but as I did I fell in love with it.
>
> It’s a little annoying to type on the standard US Keyboard layout, but its readable as a syntax and has a clear meaning once understood. This is the example that made me really love the <> operator (with PFA):
>
> ```
> $array |>= array_map(transform(…), …);
> ```
Glad you like it! I think it will really clean up a lot of code, particularly since
- it removes the need to duplicate the variable name on both sides
- it is more performant (through memoization) when there's an expression
involved without having to introduce an intermediate variable.
I think would be fantastic if this landed with PFA
Best,
Caleb