Skip to main content
What if the next PHP revolution made no noise but completely transformed your developer daily life? Forget temporary variables with the pipe operator, clone objects with astonishing simplicity, and finally enjoy full backtraces on fatal errors. And don’t forget a mandatory OPcache for guaranteed performance! PHP 8.5 was officially released on November 20th, and with it comes a number of improvements and new features that you can - as of today - begin working with on your Upsun Flex and Fixed projects. Here’s how these “under-the-hood” improvements make your code safer, faster, and more maintainable.

How to upgrade

You can explore all that PHP 8.5 has to offer on your projects today.

Install the new version

First, follow the official instructions for installing PHP 8.5 on your computer: Then you can check that it’s installed and accessible with:
php -r 'echo PHP_VERSION;'

Create a new environment

Create a branch dedicated to the latest version:
upsun branch php-85-testing

Upgrade your dependencies

Run the command:
composer upgrade

Upgrade your configuration

To upgrade your PHP version, you need to update the type YAML key in your .upsun/config.yaml file:
applications:
  your_application:
    type: "php:8.5"
And test the changes on the new environment with an upsun push. Once the environment is live, you can merge the upgrades now (upsun merge), then come back to visit many of the performance improvements and new features packaged in the release below. You can test the changes on the new environment with an upsun push. You can as always find more information about available extensions and PHP configuration in the Upsun and Upsun Fixed documentation.
A note on production upgrades:There are some noted incompatibilities that come with this new minor version release that you should keep in mind when upgrading production environments. Consult those warnings and the links below for more details.

What’s changed in PHP 8.5?

With this release comes a number of resources to better understand what’s changed, and how those changes impact your applications:

Pipe operator |>

The pipe operator changes how you chain operations, making code more linear and readable.
$result = "Hello Upsun World"
    |> htmlentities(...)
    |> str_split(...)
    |> fn($x) => array_map(strtoupper(...), $x)
    |> fn($x) => array_filter($x, fn($v) => $v !== 'O');
print_r($result);
Main benefit:
  • Makes transformations read top-to-bottom, left-to-right
  • Avoids nested parentheses:
array_filter(
    array_map(
        strtoupper(
            str_split(
                htmlentities("Hello Upsun World")
            )
        )
    ), fn($v) => $v !== 'O'
);

Integrated URI extension: goodbye parse_url()

Thanks to the new URI extension, manage URLs easily and reliably without relying on external packages.
$uri = new Uri("https://devcenter.upsun.com/posts/2025/php-85-release?fab=pot#fragment");
echo $uri->getScheme(); // https
echo $uri->getHost();   // devcenter.upsun.com
echo $uri->getQuery();  // fab=pot

Full backtraces on fatal errors

Debug critical errors more effectively with complete stack traces.
function causeError() {
    $arr = [];
    echo $arr['undefined_key']; // Notice leads to full backtrace
}
causeError();

Utility functions: array_first() and array_last()

Retrieve the first or last element of an array easily.
$items = ['upsun flex', 'random hosting', 'upsun fixed'];
echo array_first($items); // upsun flex
echo array_last($items);  // upsun fixed

Debug command: php --ini=diff

Quickly compare differences in PHP configurations.
php --ini=diff
# Shows changes between current and default php.ini

Tips for a smooth migration

  • Check dependency compatibility (extensions, modules, frameworks).
  • Enable OPCache.
  • Monitor silent changes and default behaviors.
  • Set up automated tests and simulate production flows.
  • Educate the team on new syntax (pipe) and new debugging tools.

Deprecations

You can find a list of all deprecations for PHP 8.4 on the php.net wiki.

What’s next?

PHP 8.5 is a silent revolution for anyone building modern, robust platforms, and is already Available now on Upsun. Have you tried PHP 8.5 yet? What are your findings with modules or plugins? Join us in the Discord and let us know how it goes.
Last modified on April 14, 2026