PHP 8.5 is now live across the Switchweb platform
PHP 8.5 has been fully rolled out on all Switchweb hosting environments, bringing you faster performance, cleaner syntax, and a host of developer‑friendly upgrades.
You can update your hosting package’s PHP version at any time through the PHP Version Manager in your Switchweb control panel.
WordPress compatibility
At the time of release, WordPress has beta support for PHP 8.5. WordPress marks versions as “beta‑supported” until at least 10% of WordPress sites are using that PHP release or newer.
What’s new in PHP 8.5
PHP 8.5 is a milestone upgrade that makes your codebase faster, safer, and more expressive. Here are some standout features:
1. Pipe operator (|>)
The new pipe operator lets you chain functions in a logical, left‑to‑right flow – making code cleaner and easier to read. It simplifies transformation pipelines without temporary variables, which is a big win for readability.
2. Built‑in URI extension
A brand‑new URI extension is now part of the PHP core, providing RFC 3986 and WHATWG‑compliant URL parsing and manipulation without relying on external libraries. This means more reliable, consistent handling for URLs and redirect logic.
3. Enhanced cloning for immutables
The updated clone() functionality allows you to override properties during cloning – perfect for immutable objects and readonly classes. Frameworks and APIs can now adopt simpler, boilerplate‑free “with‑er” methods for managing object states.
4. More utility functions
Everyday coding just got smoother with several new helper functions:
-
array_first()andarray_last()for quick access to endpoints in arrays. -
get_error_handler()andget_exception_handler()to retrieve current handlers. -
locale_is_right_to_left()for detecting right‑to‑left language contexts. -
A new constant
PHP_BUILD_DATEto check the PHP binary’s build timestamp. -
Command line addition:
php --ini=diffto show only configuration changes from defaults.
5. Attribute and constant expression updates
Developers can now use closures and first‑class callables in constant expressions, and even attach attributes to constants. The new #[\NoDiscard] attribute helps ensure return values are handled or explicitly ignored – improving code reliability.
6. Deprecations and removals
As with any major version, PHP 8.5 includes several clean‑ups:
-
Deprecated: non‑canonical scalar type casts (
boolean,double,integer,binary). -
Deprecated:
curl_close,curl_share_close,xml_parser_free, andsocket_set_timeout. -
Removed: CLI/CGI options
-zand--zend-extension.
Before upgrading, review your codebase and dependencies to ensure they don’t use deprecated features.
Upgrade recommendations
To make the most of PHP 8.5 and ensure a smooth transition:
-
Audit your code and dependencies for deprecated features.
-
Test applications in a staging environment first.
-
Confirm compatibility of custom or third‑party PHP extensions.
-
Update deployment pipelines to include new PHP constants and diagnostics.
-
Let your team and clients know PHP 8.5 is supported – and highlight its performance, readability, and long‑term support advantages.
Final thoughts
This release cements PHP 8.5 as one of the most developer‑focused updates yet – improving readability with the new pipe operator, adding functional‑style patterns, and modernising the ecosystem with better tools for immutability, URL handling, and debugging.
Switchweb customers can now take full advantage of all these enhancements right from their hosting dashboard.
Looking to get started on Switchweb? Take a look at our website hosting plans or message us about a free trial.