After a small delay, PHP 8.2 was published in December 2022. The latest stable version 8.2.2 was published yesterday, 2nd of February. During the upcoming days an update will be introduced to Seravo’s hosting and upkeep, and 8.2 becomes available for developers. Roll on the weekend!
However, we don’t recommend upgrading to version to 8.2 just yet. As per usual, one should wait and let the WordPress core, plugin and theme updates catch up, so that they also will support the latest PHP version. In other words, we recommend PHP 8.2 for web development and testing purposes only, for now.
Upgrading may result in errors and broken websites, if the switch to 8.2 is done haphazardly or without necessary checks. We currently recommend PHP 8.0 for WordPress sites, or 8.1 if the site’s theme and plugins already support that. Take a look at our instructions for upgrading your site’s PHP version in Seravo’s Knowledge Bank!
What’s changing in PHP 8.2?
Once again, the list of changes is reasonably lengthy, and we won’t go into details of all new features and deprecations in this article. However, we have listed some of the most important changes, come 8.2! All changes can be found at PHP official documentation or at php.watch, for example.
New Features
- New and better Random Extension: improved performance and security for random number generation
- New standalone-types: null, true ja false
- Readonly feature can now be set for an entire class
- SensitiveParameter for redacting sensitive data such as passwords from stack trace
- DNF (disjunctive normal form) types, allowing the mix of union and intersection type declarations
- Declaring constants is now possible in traits
Deprecations and Other Changes
- Deprecation of alternative syntax – type
{$var}
instead of${var}
- Dynamic properties deprecate in 8.2, and will throw an ErrorException in PHP9
- Callable Patterns partially deprecated
- Some of the mbstring-encodings deprecate
- Function getimagesize() now knows how to return the size of AVIF images
- An update for curl_upkeep() function
- Deprecation of utf8_encode() and utf8_decode() functions
For more detailed information, have a look at the PHP 8.2 migration instructions.
Other PHP versions at Seravo
Earlier in January we announced a schedule for removal of old and outdated PHP versions at Seravo’s hosting and upkeep. The support for PHP versions 5.6 and 7.0 will end during the upcoming summer this year. Read our blog about this upcoming update, or have a look at our Knowledge Bank to find out the exact dates!