Re:PHP 8.5 Adds Pipe Operator: What it means
by bapak on Tuesday August 05, 2025 @01:59AM
(#44794754)
It's chaining without having to vary the return of each function. In JS you cannot call 3.myMethod(), but you could with 3 |> myMethod
[ Parent
| on HN ]
Re:PHP 8.5 Adds Pipe Operator: What it means
by cyco130 on Tuesday August 05, 2025 @02:19AM
(#44794848)
It requires parentheses `(3).myMethod()` but you can by monkey patching the Number prototype. Very bad idea, but you absolutely can.