PHP 8 WordPress compatibility

Testing PHP 8 with WordPress

On November 26, PHP 8 was released to the world. PHP’s latest version offers new features and improvements promising to greatly enhance the security and performance of our WordPress sites.

WordPress Core is compatible with PHP 8.0 since its 5.6 release. 

But should I upgrade right away?

Let’s analyze the main changes and how to get the best PHP 8 WordPress compatibility checker.

Table of Contents

What performance changes are coming with PHP 8?

The most exciting performance feature coming to PHP 8 is JIT, “Just In Time” compilation. PHP is an interpreted language, meaning that it is translated into machine code as it runs. JIT keeps track of code that’s frequently used and attempts to optimize the machine code translation so that it can be reused. This can result in a massive performance improvement for specific functionality. 

The RFC proposal describes JIT as follows:

“PHP JIT is implemented as an almost independent part of OPcache. It may be enabled/disabled at PHP compile-time and run-time. When enabled, the native code of PHP files is stored in an additional region of the OPcache shared memory and op_array→opcodes[].handler(s) keep pointers to the entry points of JIT-ed code.”

The PHP8 compilation tests show that JIT would make CPU-intensive workloads run significantly faster. However, remember WordPress’s main bottleneck is its database. The major part of the waiting time does not come from the PHP execution, but from the MySQL process time, which cannot be solved with the help of the JIT compiler. 

Is WordPress compatible with PHP 8?

PHP 8.0 is a major version update with a large number of changes that break backward compatibility and many features that were deprecated within the PHP 7.x feature releases have been officially removed. 

One of the most important breaking changes in PHP 8is the strict typing. Many built-in functions are now pickier about the input they accept, and PHP 8 itself is more stringent about how input is passed to functions. Issues that previously resulted in notices now result in warnings, and issues that previously resulted in warnings now result in errors.

Another important compatibility problem can be, Warnings converted to error exceptions. There are a large number of PHP warnings that have been changed to error exceptions in PHP 8.

The WordPress core team has been working since release 5.6 in all these code deprecations. But, taking into consideration that WordPress is never used in isolation, (we always install third-party themes and plugins), being able to run our WordPress base install on PHP 8 does not indicate “full” compatibility.

Is my WordPress setup compatible with PHP 8?

Wait. The state of PHP 8 support within the broader ecosystem (plugins, themes, etc.) is impossible to know. For that reason, our recommendation is to check your setup in a staging environment.

A WordPress PHP 8 compatibility checker

The best WordPress PHP 8 compatibility checker you can find is a test environment running with an exact copy of your production WordPress site. It’s what we call a Staging environment.

If you do not have PHP 8 with your current provider, or your hosting does not have a Staging environment, signup! in 10 seconds, we provide you with FREE development servers.

At wetopi, with your Free or paid Plan, you can change back and forth your PHP Engine from v5.6 to v8.1.

Testing my WordPress site in a wetopi staging server

You want to check PHP8 with your WordPress site?
And don’t want to deal with the details?

We migrate your WordPress site — for free —
  1. Login to your Wetopi and go to your site page.
  2. Open the “Menú options” of your production server and click the Clone option:

    wetopi clone menu option
  3. In your new staging server: open the Menu options and the Advanced options section. There you can Switch on the PHP 8 with a single click:

    Switch from php7 to php8

Our recommendation:

PHP 8.1 is the latest version of PHP yet. This version introduces the JIT engine that, in short, developers will embrace, providing more efficiency and future performance. We also have to take in mind that PHP 7.4 is going to reach its end of life in November of 2022 and will no longer see security updates.

Being said that, our recommendation is:

— Start by testing the compatibility of your WordPress theme and plugins in a sandboxed or test environment —. and upgrade your live site if no issues arise.

We are techies passionate about WordPress. With wetopi, a Managed WordPress Hosting, we want to minimize the friction that every professional faces when working and hosting WordPress projects.

Not a wetopi user?

Free full performance servers for your development and test.
No credit card required.

See how Wetopi stacks up against your current hosting

Migrating sites to us is free and completely effortless on your part.

No hidden small text.
No commitments.
No credit card.

Try before you buy.