What PHP 8.5 Brings: Pipes, a Proper URI Parser and Handy New Helpers

What PHP 8.5 Brings: Pipes, a Proper URI Parser and Handy New Helpers

PHP 8.5 was released on 20 November 2025 and is already the recommended version for platforms such as Magento 2.4.9. Here is what developers will notice first.

The pipe operator

The new |> operator feeds the result of one expression into the next callable, reading left to right with no throwaway variables:

$slug = $title
    |> trim(...)
    |> strtolower(...)
    |> (fn($s) => preg_replace('/[^a-z0-9]+/', '-', $s))
    |> (fn($s) => trim($s, '-'));

Each step must accept a single argument, so wrap functions that need more in a short arrow function.

URLs parsed properly

A new built-in URI extension follows both RFC 3986 and the WHATWG URL standard. It is a much safer choice than the inconsistent parse_url().

Clone with

You can now change properties while cloning an object, which makes immutable “with” methods far tidier, especially on readonly classes.

Small things you will use often

  • array_first() and array_last()
  • Better backtraces for fatal errors
  • Assorted attributes and standard library improvements

Deprecations

Some legacy behaviour is now deprecated, including the backtick shortcut for shell_exec(). Run your tests with deprecation notices visible before upgrading.

Should you switch?

Start new projects on PHP 8.4 or 8.5. Move existing applications once your framework and key packages officially support 8.5.

Sources

Need a second pair of eyes on this? Our team handles web development every week. See how we can help.

Keep reading

Related articles

All articles

Need a hand?

Stuck on something similar?
We can fix it with you.

Send us the problem. A senior developer reads every message and replies within one working day.