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:Create a new environment
Create a branch dedicated to the latest version:Upgrade your dependencies
Run the command:Upgrade your configuration
To upgrade your PHP version, you need to update thetype YAML key in your .upsun/config.yaml file:
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:- A comprehensive list of all changes can be found in the ChangeLog
- A side-by-side comparison on the release homepage
- Migrating from PHP 8.4.x to PHP 8.5.x instructions, which further breaks down the changes into:
Pipe operator |>
The pipe operator changes how you chain operations, making code more linear and readable.
- Makes transformations read top-to-bottom, left-to-right
- Avoids nested parentheses:
Integrated URI extension: goodbye parse_url()
Thanks to the new URI extension,
manage URLs easily and reliably without relying on external packages.
Full backtraces on fatal errors
Debug critical errors more effectively with complete stack traces.Utility functions: array_first() and array_last()
Retrieve the first or last element of an array easily.
Debug command: php --ini=diff
Quickly compare differences in PHP configurations.
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.