PHP 8.5: Pipe Operator, URI Extension and Everything Else You Need to Know
PHP 8.5 landed on 20 November 2025 with the pipe operator, a built-in URI extension, clone-with and new array helpers. Here is what matters for projects.
PHP 8.5 was released on 20 November 2025. It is now the top supported version for platforms such as Magento 2.4.9, so it is worth understanding what changed.
The pipe operator |>
The headline feature. It passes the result of one expression into the next callable, left to right, without temporary variables:
$slug = $title
|> trim(...)
|> strtolower(...)
|> (fn($s) => preg_replace('/[^a-z0-9]+/', '-', $s))
|> (fn($s) => trim($s, '-'));
One caveat: each step must be a callable that accepts exactly one parameter — wrap multi-argument functions in a short arrow function.
A built-in URI extension
Parsing URLs correctly is surprisingly hard. PHP 8.5 ships a standards-compliant URI extension supporting both RFC 3986 and the WHATWG URL standard, replacing many uses of the quirky parse_url().
Clone with
Modifying properties while cloning makes immutable “wither” methods much cleaner, especially with readonly classes.
Small helpers you will use daily
array_first()andarray_last()— finally.- Improved error and fatal-error backtraces for easier debugging.
- New attributes and quality-of-life improvements across the standard library.
Deprecations to watch
A batch of legacy behaviour is deprecated — including the backtick operator as an alias for shell_exec(). Run your test suite with deprecations visible before upgrading production.
Should you upgrade?
New projects should start on PHP 8.4 or 8.5. For existing apps, upgrade once your framework and dependencies officially support 8.5 — Magento 2.4.9, recent Laravel and Symfony releases, and WordPress all do or are close.
Need help modernising a legacy PHP codebase? See our PHP services.
Sources
Planning your PHP 8.5 upgrade
New syntax is exciting, but the real value of PHP 8.5 is staying on a supported, secure runtime. Check the official PHP supported versions page to see how long your current version will receive security fixes, then plan backwards from that date.
- Check your framework and CMS. Laravel, Symfony, WordPress, Drupal and Magento each publish their own PHP compatibility notes — your platform decides when you can move.
- Add PHP 8.5 to CI. Run your test suite against both your current version and PHP 8.5 so you see deprecations long before production.
- Fix deprecations first. Deprecation notices become errors in later versions; clearing them now makes the next upgrade easier too.
- Upgrade staging, then production. Watch error logs and performance for a few days on staging before switching live traffic.
Once you are on PHP 8.5, adopt the new features gradually. The pipe operator and clone-with make new code cleaner, but there is no need to rewrite working code just to use them. The full list of changes is in the official release announcement.
