PHP 7.4 reaches End of Life: What is next for WordPress

Almost half of WordPress installs still use PHP 7.4 (56.9%).

PHP 7.4 is no longer be maintained since November 2021, and will only have a minimal security maintenance support until 28 November 2022.

Meanwhile, PHP 8.0 has been released since November 2020, a year after 7.4, the latest version of PHP is 8.1 (November 2021) and the next version, 8.2, is scheduled for November 2022.

PHP 8.1 is a major update and brings a number of changes to the language when compared to version 7.4. It contains many new features, including enums, readonly properties, first-class callable syntax, fibers, intersection types, Just-In-Time (JIT) compiler, and most importantly, performance improvements.

What are the benefits of the latest version

Based on some benchmarks across different platforms, there’s an observed performance improvement from 2.6% to nearly 12%.

PHP Compatibility and WordPress Versions

WordPress aims to support new versions of PHP on the day they are released as much as possible. As a project, the process of supporting these new versions begins after each new PHP version has hit feature freeze and are tagging beta versions. This prevents having to revert or make additional changes to WordPress if a planned feature is removed or the implementation changes.

Past changes to supported PHP versions have been as followed:

  • In WordPress 5.3: Added support for PHP 7.4.
  • In WordPress 5.6: Added “beta support” for PHP 8.0.
  • In WordPress 5.9: Added “beta support” for PHP 8.1.
  • In WordPress 6.1: Added “beta support” for PHP 8.2.

WordPress supports PHP 8.1 since version 5.9 in beta support and, while it is not fully compatible with PHP 8.0 or 8.1, all remaining known PHP 8.1 issues are deprecation notices. A deprecation notice is not an error, but rather an indicator of where additional work is needed for compatibility before PHP 9 (i.e. when the notices become fatal errors).

What Is Holding Back Users From Updating to PHP 8.1?

The major reason that’s holding back users from upgrading to PHP 8 is the incompatibility of their favorite themes and plugins with PHP 8.

That said, every savvy user would like to enjoy the latest PHP features and RFC improvements. Anyone who wants to stay back and keep working with the legacy software would abstain from upgrading their PHP version.

Using the latest PHP versions allows us better and easier development of new features and also facilitates maintenance. Even if some of the themes and plugins are not working on PHP 8.1, they will eventually be updated.

What to do

If you’re still running any PHP version older than 8.x, you need to talk to your engineering team or development agency as soon as possible.

PHP 8.x is a major version upgrade from PHP 7.4, and unfortunately it has less backwards compatibility and does deprecate a few functions.

The big challenge for this upgrade is legacy code, tech debt and third party plugins that you may be using. If you have a relatively large codebase and a site with many features, you need time and expertise to do this upgrade.

About PHP 8.1

There are fewer changes between PHP 8.0 and PHP 8.1 than there are between PHP 7.4 and 8.0, which means that there should be fewer incompatibilities to address.

  • Has active support from the PHP core developers until Nov 2023, and security support until Nov 2024.
  • Can handle more requests per second than PHP 8.0.
  • Has “beta compatibility” support on WordPress 5.9 and above – this means that there are some deprecation notices in preparation for PHP 9, but doesn’t affect the behavior of WordPress core.

If you’re just getting started, feel free to contact me to get some help. And while you’re at it, we will go all the way to PHP 8.1!