ServicePHP 8.5 is the current PHP release: key changes and when to upgradehostinq.com

PHP 8.5 is the current PHP release: key changes and when to upgrade

PHP 8.5 is the newest stable version of PHP as of 5 November 2026. It was released on 20 November 2025, and the latest update in the branch is PHP 8.5.12, published on 21 October 2026. The next version, PHP 8.6, is in its final release candidate stage and is scheduled for general availability on 19 November 2026.

This post covers what PHP 8.5 changed, which versions are still supported, and how to plan an upgrade without breaking your site.

Supported PHP versions today

Each PHP branch receives two years of active support (bug and security fixes) followed by two years of security fixes only.

VersionReleasedActive support untilSecurity fixes until
8.520 November 202531 December 202731 December 2029
8.421 November 202431 December 202631 December 2028
8.323 November 202331 December 202531 December 2027
8.28 December 202231 December 202431 December 2026

PHP 8.1 reached end of life on 31 December 2025, and PHP 8.2 will follow at the end of this year. If your site runs on 8.1 or older, it no longer receives security fixes.

A critical security release in October 2026

On 21 October 2026, the PHP project released 8.5.12, 8.4.27, 8.3.36 and 8.2.35 to fix two critical remote code execution vulnerabilities, each rated 9.2 under CVSS v4.0. The advisory states that configuration changes can reduce exposure but do not make an installation safe, and that updating is the only safe choice. Whatever version you run, make sure it is at least at the patched release for its branch.

Key changes in PHP 8.5

The pipe operator

The new |> operator passes a value to the next callable, which makes chains of function calls easier to read:

$slug = $title
    |> trim(...)
    |> strtolower(...);

Clone with

clone now works like a function and accepts an array of properties to change, including readonly properties. This simplifies the "with-er" methods common in immutable objects.

The URI extension

A new, always-enabled URI extension parses and handles URLs according to RFC 3986 and the WHATWG URL standard. It is a more reliable alternative to older approaches such as parse_url().

The #[\NoDiscard] attribute

Functions marked with #[\NoDiscard] trigger a warning when their return value is ignored. Casting the call to (void) shows that ignoring it is intentional.

Other useful additions

  • array_first() and array_last() return the first and last value of an array.
  • Closures, casts and first-class callables can be used in constant expressions, such as attribute arguments and default values.
  • Fatal errors, such as an exceeded maximum execution time, now include a backtrace, which makes them easier to debug.
  • cURL share handles can persist across requests, allowing better connection reuse.
  • Attributes can be applied to constants, and #[\Override] can be used on properties.
  • getimagesize() now supports HEIF/HEIC and SVG.

Deprecations to watch

Deprecations do not break code yet, but they produce warnings and signal what will be removed in a future major version. The most common ones in PHP 8.5:

  • Non-canonical casts such as (boolean), (integer), (double) and (binary). Use (bool), (int), (float) and (string).
  • The backtick operator as an alias of shell_exec().
  • Ending a case statement with a semicolon instead of a colon.
  • Using null as an array offset.
  • Calls to curl_close(), finfo_close(), imagedestroy() and xml_parser_free(), which no longer do anything useful because these objects are freed automatically.
  • The $http_response_header variable, replaced by http_get_last_response_headers().

Older plugins and themes are the most likely to trigger these warnings.

When should you upgrade?

  • On PHP 8.1 or older: upgrade now. These versions get no security fixes.
  • On PHP 8.2: plan the move before 31 December 2026, when security support ends.
  • On PHP 8.3 or 8.4: you are supported, so you can move when your software is ready. A move to 8.4 or 8.5 extends your support window.
  • Considering PHP 8.6: wait for the stable release on 19 November 2026 and for your CMS and plugins to confirm compatibility. Release candidates are not meant for production.

For WordPress, the official requirements page recommends PHP 8.3 or greater.

What this means for you

  1. Check your current version in your control panel or with php -v on a server, and confirm it includes the 21 October 2026 security fix.
  2. Test on a copy first. Clone the site to a staging environment, switch it to the new version and click through key pages, forms and checkout. Our guide on staging environments explains the approach.
  3. Read the error log. Look for deprecation notices and fatal errors after the switch. Our article on reading server logs can help.
  4. Update plugins, themes and Composer packages before changing PHP, since newer releases usually add support for new versions.
  5. Keep a way back. Take a fresh backup, and note the previous version so you can switch back if something fails.

On cPanel hosting, the PHP version is usually changed per site in the PHP version tool of the control panel. If you are not sure which versions are available on your plan, our support team can confirm. For background, see our earlier articles on PHP 8.4, choosing a PHP version and PHP OPcache.

Sources

Share: