PHP 8.4 compatibility checker for WordPress: what it must find, and how to run one

By CompatNav · Published · Last reviewed · 4 min read

Short answer

A PHP 8.4 check for WordPress must find one change that stops code: five MySQLi constants PHP 8.4 removed, which end the page with a fatal error. And eight that add deprecation notices: parameters made nullable only by = null, the E_STRICT constant, trigger_error() with E_USER_ERROR, deprecated functions such as lcg_value(), and more. It can’t see the extensions PHP 8.4 no longer includes (IMAP, OCI8, PDO_OCI, PSpell): that’s a question for your host. The free CompatNav plugin runs these 9 checks for PHP 8.4, plus those of every version between yours and 8.4, on your own server.

Why check for PHP 8.4

PHP 8.4 gets security fixes until 31 December 2028, a year longer than 8.3 (php.net). For a site leaving PHP 8.2, whose fixes end on 31 December 2026, it is a natural target. WordPress 7.0 and 7.1 support it (PHP requirements of WordPress 7); whether your site does depends on its plugins and theme.

What a PHP 8.4 checker must find

These are CompatNav’s 9 checks for PHP 8.4, each one a change from php.net’s lists of deprecated features and incompatible changes:

In the codeOn PHP 8.4
Five removed MySQLi constants, such as MYSQLI_TYPE_INTERVALWill break: fatal error
A parameter made nullable only by = null (string $note = null)Deprecation notice
The E_STRICT constant, and others: CURLOPT_BINARYTRANSFER, SUNFUNCS_RET_*, MYSQLI_REFRESH_*Deprecation notice
trigger_error() with E_USER_ERRORDeprecation notice
lcg_value(), mysqli_ping(), mysqli_kill(), mysqli_refresh(), xml_set_object()Deprecation notice
fputcsv(), fgetcsv(), str_getcsv() without the escape argumentDeprecation notice
session_set_save_handler() with separate functionsDeprecation notice
A class named _Deprecation notice
Built-in methods overridden without the return type PHP 8.4 now expectsDeprecation notice

A good checker also skips code that already protects itself, for example with a PHP version check or function_exists(), so it doesn’t raise false alarms.

The one that stops code

A plugin that names one of the removed MySQLi constants runs on PHP 8.3 and stops on 8.4:

wp-content/plugins/table-viewer/includes/columns.php

<?php
$field_type = 247; // the type number MySQL reports for a column
if ($field_type === MYSQLI_TYPE_INTERVAL) {
    echo "List column\n";
}
echo "Done\n";

Output on PHP 8.3.35

List column
Done

Output on PHP 8.4.26the script stopped

Fatal error: Uncaught Error: Undefined constant "MYSQLI_TYPE_INTERVAL" in /var/www/html/wp-content/plugins/table-viewer/includes/columns.php:3
Stack trace:
#0 {main}
  thrown in /var/www/html/wp-content/plugins/table-viewer/includes/columns.php on line 3

A notice from everyday code

PHP 8.4 deprecates making a parameter nullable only through its default value, a way of writing that was normal for years. The code keeps working, with a notice each time the file loads:

wp-content/plugins/order-notes/order-notes.php

<?php
class Order_Note {
    public function __construct(string $text, DateTime $created = null) {
        echo $text, $created ? ' (dated)' : ' (no date)', "\n";
    }
}

new Order_Note('Gift wrap');

Output on PHP 8.3.35

Gift wrap (no date)

Output on PHP 8.4.26

Deprecated: Order_Note::__construct(): Implicitly marking parameter $created as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/wp-content/plugins/order-notes/order-notes.php on line 3
Gift wrap (no date)

More on this one, with the fix: “Implicitly marking parameter as nullable is deprecated”. All the PHP 8.4 changes in plain words: WordPress and PHP 8.4.

What no checker can see

  • Extensions. PHP 8.4 no longer includes IMAP, OCI8, PDO_OCI and PSpell. Whether your host still installs them for 8.4 is a server question, not a code one: IMAP and PHP 8.4 shows what happens when one is missing, and what to ask.
  • Values. Some problems depend on the data a site handles while it runs. Your error log shows them after the switch (the WordPress debug log).

Run the check

  1. Install CompatNav: Plugins → Add New Plugin, search for CompatNav, install and activate it. It’s free, from wordpress.org, and needs WordPress 6.0 and PHP 7.4 or newer.
  2. Open Tools → CompatNav, and next to Check readiness for, choose PHP 8.4.
  3. Start the scan. It runs in short background steps on your own server, with a progress bar; on a test site with 17 plugins and themes, about 70 seconds.
  4. Read the verdict: “Safe to upgrade”, or “Not ready yet” with what to do first. Reading the report explains each finding.

CompatNav compares the PHP version your site runs today with the one you choose and reports only what changes between the two. From PHP 8.3, that’s the 9 checks above. From 8.2, the 4 checks for 8.3 as well, 13 in all. From 7.4, every check for 8.0 to 8.4: 45. Whatever the version, it also reports a file that PHP 8.4 can no longer read at all.

Nothing leaves your server: no code, file names or results are sent anywhere, and the check only reads files.

Key takeaways

  • PHP 8.4 gets security fixes until 31 December 2028, a year longer than 8.3.
  • One code change stops a page on 8.4: the five removed MySQLi constants. Eight others only add deprecation notices.
  • A typical notice: parameters like string $note = null, to be written ?string $note = null from now on.
  • No code check sees whether your host still has the IMAP extension: PHP 8.4 no longer includes it.
  • Coming from 8.2, the check covers 8.3 and 8.4: 13 checks. From 7.4: 45.

Frequently asked questions

Is there a free PHP 8.4 compatibility checker for WordPress?

Yes. CompatNav is free on wordpress.org: choose PHP 8.4 as the version you’re moving to, and it checks every plugin and theme on your own server, with a verdict in plain words.

Will deprecation notices break my site on PHP 8.4?

No. They are written to the error log, and the code keeps working. They matter later: PHP usually removes what it deprecated in a later version.

My check says “Safe to upgrade to PHP 8.4”. Can anything still go wrong?

Two things no code check sees: an extension your host doesn’t install for 8.4, and problems that depend on values while the site runs. Ask your host about extensions, and watch the error log for a week after switching.

Check your own site before you upgrade

CompatNav is a free WordPress plugin. It reads the code of your plugins and themes on your own server and tells you, in plain words, what will break and what will only show notices on the PHP version you choose. It never changes your code. It can’t see problems that only appear while code runs with real data, so a quick check of your site after the upgrade still matters.

Get CompatNav on wordpress.org How it works

Sources

About the code examples: each output is the real output of the code shown, run with the official PHP builds, without a php.ini, with all errors reported and displayed. Only the file path was replaced by a neutral server path.