← News

PHP 8.5 now available on all hosting plans

News 4 min read

PHP 8.5 is now available on all hosting plans, so you can take advantage of the latest improvements and optimisations this version brings. Switching between versions takes just a few seconds thanks to the PHP version selector in the cPanel control panel.

What's new

The most notable improvements in this version include:

  • URI Extension: a new native extension to parse, normalise and handle URIs and URLs following the RFC 3986 and WHATWG URL standards. A more robust and secure alternative to parse_url().
  • Pipe Operator (|>): a new operator that chains function calls from left to right, removing the need for intermediate variables and making code easier to read.
  • Clone With: you can now clone objects and change their properties in a single step with clone($objeto, ['propiedad' => valor]), simplifying the "with-er" pattern for readonly classes.
  • #[\NoDiscard] attribute: lets you mark functions so PHP emits a warning if the return value isn't used, making APIs safer.
  • array_first() and array_last(): new functions to get the first or last element of an array easily.
  • Closures in constant expressions: static closures can now be used in attribute parameters, default values and constants.
  • Persistent cURL share handles: cURL handles can now persist between PHP requests, reusing connections and improving performance.

For full details of everything that's new, we recommend you read the official PHP 8.5 release notes.

Compatibility and migration

As with previous versions, PHP 8.5 doesn't bring major changes likely to cause conflicts if your current application runs on modern PHP versions (8.0+). A few minor changes to bear in mind:

  • The backtick operator (`) as an alias of shell_exec() is deprecated
  • The non-canonical casts (boolean), (integer), (double) and (binary) are deprecated (use (bool), (int), (float) and (string))
  • The __sleep() and __wakeup() magic methods are soft-deprecated in favour of __serialize() and __unserialize()

So we recommend these steps when upgrading:

  1. Read the official migration guide in case your application needs any changes
  2. Change the PHP version from the selector in cPanel
  3. Check that everything works correctly
  4. If you find a problem, you can simply go back to the previous version in a few seconds and everything will be as it was, working again

Recommendations

To get the best performance and security from your applications, we recommend:

  • Always keeping your PHP version up to date with the latest one your application supports
  • Enabling the opcache module to optimise performance
  • Checking plugin and theme compatibility if you use a CMS such as WordPress, Joomla, etc.

If you run into any problem during the upgrade, you can go back to the previous version from the PHP selector in cPanel and contact us so we can help you sort it out.

Available versions

Remember that besides PHP 8.5, we keep earlier versions available to ensure compatibility with legacy applications, all with their security patches thanks to CloudLinux:

  • PHP 8.5 (New)
  • PHP 8.4
  • PHP 8.3
  • PHP 8.2
  • PHP 8.1
  • PHP 8.0
  • PHP 7.4 and earlier

The flexibility to switch between versions lets you keep your applications compatible while you get ready to upgrade to newer versions.

We keep improving.

See what we're working on right now or write to us if something's missing.