Re:PHP 8.5 Adds Pipe Operator: What it means
by wouldbecouldbe on Tuesday August 05, 2025 @01:25AM
(#44794577)
It looks like chaining, but with possibility of adding custom functions?
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
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.
More like thenables / promises