A new version of the PHP programming language (PHP 8.4) was released late last month, on 21.11.2024. On the same day, security updates for older versions of PHP were also released, including PHP 8.1.31, PHP 8.2.26, and PHP 8.3.14.
In addition to entirely new features, PHP 8.4 includes performance improvements and bug fixes. In this article, we’ll go through the most significant changes in PHP 8.4. For the most comprehensive information about the new 8.4 release and the changes that come with it, visit the official PHP website.
New Features in PHP 8.4
Compared to its predecessor PHP 8.3, the new PHP 8.4 includes many exciting features and new features for developers, such as:
- New functions for arrays
array_find_key()
array_all()
array_any()
- New
mbstring
functionsmb_trim()
mb_ltrim()
mb_rtrim()
- New
mb_ucfirst
andmb_lcfirst
functions - Asymmetric visibility for properties
- Property Hooks
- Updated DOM API
- Parsing for HTML5 (new
DomHTMLDocument
class)
- Parsing for HTML5 (new
- New features for the cURL extension, such as
CURLINFO_POSTTRANSFER_TIME_T
constant- New constants for HTTP/3 support
http_get_last_response_headers
andhttp_clear_last_response_headers
- List cURL features and their support in
curl_version()
grapheme_str_split
function- Improvements for password encryption
- Support for new AEGIS algorithms
- Changes to Bcrypt cost parameter (earlier 10, now 12)
- New
bcdivmod
function - Uusia pyöristystapoja
round()
-funktioon createFromTimeStamp
,getMicrosecond
jasetMicrosecond
-metodit- PHP integer size information now visible in
phpinfo()
- Update to regular expressions (PCRE2)
request_parse_body()
for parsing HTTP requests
Deprecations in PHP 8.4
The following constants, functions and features are no longer supported in PHP 8.4:
- Implicitly nullable parameters are deprecated (read more)
- E-STRICT constant (read more)
- Deprecation of calling
session_set_save_handler()
function, if there are more than two arguments (read more) $escape
parameter in CSV handling (read more)CURLOPT_BINARYTRANSFER
constant (read more)SUNFUNCS_RET_*
constants (read more)
PHP 8.4 and WordPress Compatibility
At the time of writing, the latest released version of WordPress is 6.7, and PHP 8.2 is the recommended version for it. WordPress 6.7 already contains initial code changes that foresee compatibility with PHP 8.4.
PHP 8.3 is beta-supported in WordPress version 6.7. Beta support means that it can be used for testing, and could be used for example in completely new WordPress installations. However, PHP 8.3 is not yet recommended for use on a live production site.
Is PHP 8.4 Available at Seravo?
PHP 8.4 is not available at Seravo just yet, but we will update this article and Seravo’s Knowledge Bank as soon as it becomes available in our WordPress hosting. We always aim to make the latest version of PHP available for site developers as soon as possible.
Currently, the default PHP version for new WordPress installations in Seravo’s hosting is PHP 8.2.
When Is the Right Time to Upgrade PHP on a WordPress Site
Upgrading PHP and keeping PHP updated on WordPress sites is important, as running an outdated version may degrade the security of a site. Older versions of PHP are no longer supported by PHP developers, and so updates that fix security vulnerabilities are no longer released. You can view the schedule for PHP versions’ EOL (end-of-life) on Seravo’s Knowledge Bank.
It’s a good idea to upgrade PHP in a WordPress site once all plugins, themes and of course the WordPress core support a newer PHP version.
Of course, it will take some time from the release of the new PHP version until the site components are up-to-the-minute. It is therefore not necessary to upgrade to the latest version of PHP as soon as it is released. Seravo provides tools for testing PHP compatibility with WordPress and its plugins.
Upgrading PHP Version in WordPress
When your site is hosted by Seravo, switching between PHP versions is easy. Log in to your site and find Seravo Plugin settings in the Tools > Upkeep menu. We recommend testing the new PHP version in a shadow environment. Please also refer to our Knowledge Bank for instructions on how to upgrade PHP. Our WordPress hosting plans do not include automatic PHP updates, but we of course provide tools and help to make you succeed in the upgrade.
Expert Help in PHP Upgrades
Seravo’s customers may purchase a PHP upgrade for their WordPress site as an additional service. Check out all additional services and prices! Ordering additional services is quick and easy by contacting our customer service team via email (help@seravo.com).