PHP 8.5 is now available (and what’s new)

From Reseller Hosting and Managed WordPress Hosting to Web Hosting and Managed Cloud Servers, PHP 8.5 is now fully deployed across the 20i platform.

That means you can take advantage of PHP 8.5’s performance improvements, cleaner syntax and developer‑friendly features.

Easily change any of your hosting packages’ PHP version in My20i’s PHP Version Manager.

Resellers can make PHP 8.5 the default version for new packages in ‘Hosting Package Types‘. Simply edit your existing Package Type(s) or create a new one.

A note on WordPress: WordPress currently has beta support for PHP 8.5. Support for any given version of PHP is labelled as “beta support” until at least 10% of all WordPress sites are running that version or later.

What’s new in PHP 8.5?

PHP 8.5 brings a range of developer‑focussed enhancements that aim to make code cleaner, safer and more expressive

1. Pipe operator

One of the most visible additions is the new pipe operator (|>). This allows you to chain callables in a left‑to‑right style, passing the return value of each into the next. It reduces nested calls, improves readability and aligns with functional‑style patterns.

Example before PHP 8.5:

$result = strtolower(
    str_replace('.', '',
        str_replace(' ', '-',
            trim($title)
        )
    )
);

With PHP 8.5:

$result = $title
    |> trim(...)
    |> (fn($str) => str_replace(' ', '-', $str))
    |> (fn($str) => str_replace('.', '', $str))
    |> strtolower(...);

This means fewer temp variables, clearer pipeline logic for data transformations, and easier maintenance.

2. URI extension (built‑in)

PHP 8.5 introduces a new built‑in URI extension for parsing, normalising and manipulating URLs/URIs according to RFC 3986 and WHATWG standards.

This means developers no longer need to rely on third‑party libraries for robust URL handling. You can use something like:

use Uri\Rfc3986\Uri;

$uri = new Uri('https://example.com/path?query=1');
echo $uri->getHost(); // example.com

This new feature simplifies reliable URL parsing, sanitisation and manipulation, which helps when building link‑builders, redirect logic, or multi‑tenant router systems.

3. Clone with / Immutable cloning enhancements

Another significant improvement is the enhanced clone usage. Yu can now pass a second parameter to clone() to override properties during cloning, enabling more concise “with‑er” patterns especially for readonly or immutable objects.

readonly class Colour {
    public function __construct(
        public int $red,
        public int $green,
        public int $blue,
        public int $alpha = 255,
    ) {}
    public function withAlpha(int $alpha): self {
        return clone($this, [
            'alpha' => $alpha,
        ]);
    }
}

For frameworks, plugins or large scale apps, this gives a cleaner immutable‑friendly API, reducing boilerplate for object state transformations.

4. New utility functions and helper features

There are several additions that enhance everyday developer ergonomics:

  • array_first() and array_last() functions to directly access the first and last values of an array.
  • New functions get_error_handler() and get_exception_handler() to retrieve the current handlers rather than having to rely on hacks.
  • locale_is_right_to_left() (and method Locale::isRightToLeft()) to test whether a given locale writes right‑to‑left — useful for i18n / UI logic.
  • A new PHP_BUILD_DATE constant so you can check the build timestamp of the PHP binary.
  • CLI addition: php --ini=diff which shows only INI settings that deviate from defaults.

5. Attribute and constant expression enhancements

Other language refinements include:

  • Support for closures and first‑class callables inside constant expressions (e.g., attributes, default values), expanding compile‑time expressiveness.
  • The #[\NoDiscard] attribute, which enables you to mark functions so that their return value must be used (or explicitly ignored via (void)), helping to prevent subtle bugs.
  • Allowing attributes on constants (not just classes and methods).

6. Deprecations and removals to note

As always, each major version includes cleanup. In PHP 8.5 some functions and practices are deprecated or removed:

  • Non‑canonical scalar type casts are deprecated (e.g., boolean|double|integer|binary).
  • curl_close and curl_share_close are deprecated because they have been effective no‑ops in PHP 8.0+.
  • xml_parser_free is deprecated for similar reasons.
  • socket_set_timeout is deprecated in favour of stream_set_timeout.
  • On the removal front: the CLI/CGI options -z / --zend-extension have been removed.

Projects upgrading should review their codebase (and dependencies) for use of deprecated features and ensure compatibility ahead of full production roll‑out.

Upgrade considerations

We usually see faster websites on newer PHPs so we encourage people to upgrade. When preparing to support or upgrade to PHP 8.5 we recommend the following checklist:

  • Audit your codebase and dependencies for deprecated functions (per section above).
  • Test applications on PHP 8.5 in a staging environment: check for compatibility, error logs and performance.
  • Verify that any custom PHP extensions (especially 3rd‑party or older ones) are compatible with PHP 8.5.
  • Update deployment pipelines or CI/CD to recognise the new PHP_BUILD_DATE constant and other diagnostics.
  • Communicate to developers and end‑clients that you’re supporting PHP 8.5, highlighting benefits such as cleaner code, modern features and longer support lifecycle.

Final thoughts

PHP 8.5 delivers a substantial collection of well‑thought‑out improvements that directly address everyday developer needs: readability (pipe operator), expressiveness (clone with, closures in constants), utility (array_first/last, locale checks), and hosting/top‑level tooling (URI extension, CLI diff).



Upgrade your hosting 📈 Unleash your websites 🚀

Build, deploy & manage all your sites/apps at scale. Use our high-spec cloud servers to ensure blazing-fast load times, every time. Get market-leading speed, security & customer support.

  • WordPress, WooCommerce, Laravel optimisations & more
  • One click migration from any host, any time
  • Free Email, DNS, CDN, SSL, SSH, Backups, Security & Git integration all baked-in
  • Global reach with 60+ global data centres
  • Award-winning support from real people

Find out why over 1 million agencies, online stores, developers, multi-site hosting and high traffic sites use our Managed Cloud Servers to ensure peak performance, every time.



Previous Article

How to Use Newsletters to Build and Retain Customers 

Next Article

All New Christmas Cards for Resellers!

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *