Re:PHP 8.5 Adds Pipe Operator: What it means
by procaryote on Tuesday August 05, 2025 @11:56AM
(#44799690)
Put it in a function and the scope you pollute is only as big as you make it.
[ Parent
| on HN ]
Re:PHP 8.5 Adds Pipe Operator: What it means
by hombre_fatal on Tuesday August 05, 2025 @12:08PM
(#44799871)
Functions also pollute the scope the same way. And you don't want to be forced to extract a function that is never reused just to hide intermediate values; you should only have to extract a function when you want the abstraction.
The pipeline transformation specifically lets you clean this up with functions at the scope of each ephemeral intermediate value.
Re:PHP 8.5 Adds Pipe Operator: What it means
by skoskie on Tuesday August 05, 2025 @03:37PM
(#44803188)
That’s why we have classes and namespaces.
Anyone can write good or bad code. Avoiding new functionality and syntax won’t change that.