Each major and minor PHP release brings changes worth understanding beyond the changelog. This series covers what actually matters in each version: the features that stuck, the ones that didn’t, and why they were added in the first place.
PHP 8.5: the pipe operator, a URI library, and a lot of cleanup
PHP 8.5 shipped November 20th. Two features define this release: the pipe operator and the URI extension. They solve different problems, but both share the same motivation: making common operations less awkward to express. The pipe operator Functional pipelines in PHP have always been a mess. Chaining transformations meant either nesting function calls inside out, or breaking them into intermediate variables: // before — read right to left $result = array_sum(array_map('strlen', array_filter($strings, 'strlen'))); // or verbose but readable $filtered = array_filter($strings, 'strlen'); $lengths = array_map('strlen', $filtered); $result = array_sum($lengths); // after — read left to right $result = $strings |> array_filter(?, 'strlen') |> array_map('strlen', ?) |> array_sum(?); The |> operator passes the left-hand value into the right-hand expression. The ? placeholder marks where it goes. Pipelines now read in the order operations happen: left to right, top to bottom. ...