Blog
SavedSearch
Visit Hostlelo

PHP 8.6 Is Out: Test Your WordPress Site Before You Switch

PHP 8.6 deprecates spl_object_hash() and more. Scan your plugins, test on staging with the debug log, read the errors and decide when production moves.

The short answer

PHP 8.6 was released on 19 November 2026, and WordPress 7.2 is fully compatible with it as of Beta 5, with the final release scheduled for 8 December 2026. Your plugins and theme are the real risk: a WordPress scan found nearly 9,000 uses of the now deprecated spl_object_hash() across more than 2,300 plugins. Test on a staging copy running WordPress 7.2 with WP_DEBUG_LOG on, scan your plugins with grep, and move production only when the log shows no fatal errors.

Staging website testing a new PHP runtime with isolated data and a private debug log
Reading options

On this page

Before you start

An isolated private staging copy with its own database, production-side effects disabled (real payments, customer email, webhooks and cron), an off-server production backup, panel and SSH access, and a private rollback folder outside public_html.

Yes, you can test your WordPress site on PHP 8.6 today, but do it on a staging copy first and keep production where it is until your plugins pass. PHP 8.6 came out on 19 November 2026, and WordPress itself is ready for it from version 7.2, which is scheduled for 8 December 2026.

Here is the part that surprised me. A WordPress core developer note published on 23 November 2026 says: "A brief scan of the plugin directory shows nearly 9,000 occurrences of spl_object_hash() across 2,300+ plugins." PHP 8.6 deprecates that exact function. So the real question is less "should I upgrade PHP?" and more "does anything in my plugin list still use it?"

By the end of this guide you will be able to set up a safe test, scan your own plugins for the risky functions, turn on the error log, read what it says, and decide when production can move.

What PHP 8.6 actually changes for a WordPress site

PHP is the language WordPress and its plugins are written in. Each new version adds features and marks some old ones as "deprecated", which means "still works for now, but will be removed later".

Think of a city updating its building code. Your house does not fall down the day the new code is published. The inspector just starts writing notes about the old wiring, which a later code will ban.

At the time of writing (29 November 2026), the official PHP supported versions page lists PHP 8.6 with active support until 31 December 2028 and security support until 31 December 2030. Active support means bug fixes; security support means only security fixes.

These are the PHP 8.6 changes most likely to show up on a WordPress site, from the official release page and the manual's deprecation list:

  • spl_object_hash() is deprecated in favour of spl_object_id(). Plugins use it to give each PHP object a unique label.
  • The mbstring regular expression functions, such as mb_ereg(), mb_ereg_replace() and mb_split(), are deprecated because the Oniguruma library behind them is no longer maintained. The manual says they "will be removed in PHP 9.0".
  • The old aliases is_double(), is_long(), is_integer() and doubleval() are deprecated. Their modern names are is_float(), is_int() and floatval().
  • strcoll() and the SORT_LOCALE_STRING sort flag are deprecated, with the Collator class from the intl extension as the replacement.
  • Using return inside a finally block now "emits a compile-time deprecation notice", in the words of the manual.
  • fclose(), file_put_contents() and copy() "now return false when flushing or closing the stream fails, instead of silently ignoring the failure."
  • Sessions are stricter by default: session.use_strict_mode and session.cookie_httponly are on, and session.cookie_samesite is set to Lax.
  • "Many functions now throw a ValueError for out-of-range values, invalid flags, or strings containing NUL bytes, instead of silently truncating or ignoring them."

Why this matters: a deprecation is a notice in a log file and does not crash your site by itself. The last three items are different. A function that now returns false, or throws a ValueError nobody catches, can change what happens on the page.

What the WordPress team says

The core post "WordPress and PHP 8.6" by Jonathan Desrosiers says: "WordPress 7.2 is fully compatible with PHP 8.6 as of the Beta 5 release." It also says "all known PHP 8.6 compatibility issues in WordPress Core have been resolved."

Two more details matter. WordPress 7.2 keeps the minimum supported PHP version at 7.4, so nothing forces you to move. And "Support for new PHP versions is not backported to older WordPress branches", so PHP 8.6 testing only makes sense on WordPress 7.2 or later.

Core being ready says nothing about your plugins and theme. That part is yours to test.

Before you start

Here is what you need before touching any PHP setting:

  • A private staging copy with its own database. Disable real payment capture, outbound customer email, webhooks and production cron jobs before testing. If you do not have an isolated copy yet, follow the WordPress 7.2 staging guide first.
  • A fresh full backup of production (files and database), stored somewhere other than the server.
  • Access to your hosting panel, to check whether your host offers PHP 8.6 and to switch the staging site only.
  • SSH access for the scan and the WP-CLI checks. WP-CLI is the official command line tool for WordPress.
  • A list of your important pages and actions: checkout, contact form, login, image upload, search.
  • One to two hours for a small site. Risk is low, as long as everything happens on staging.

Heads up: not every host has added PHP 8.6 yet. At the time of writing I found no official cPanel documentation confirming PHP 8.6 in EasyApache, so I give no menu path for it. If your host does not offer 8.6 yet, the scan in Step 3 still tells you most of what you need.

Step by step: test your site on PHP 8.6

Step 1: Check your WordPress and PHP versions

On the staging site, this command prints the installed WordPress version.

wp core version

You should see a single version number. If it shows something lower than 7.2, update staging to the release candidate before testing PHP 8.6 (see Step 2).

This command prints details about the PHP that WP-CLI itself uses, including a line that starts with PHP version:.

wp cli info

Quick tip: the PHP used on the command line is sometimes a different binary from the one serving your website. To see the version your site really runs, open Tools > Site Health > Info in the WordPress dashboard and expand the Server section, which lists your server and PHP details.

Step 2: Put WordPress 7.2 on staging

WordPress 7.2 RC3 was published on 24 November 2026, and the final release is scheduled for 8 December 2026. That is a schedule, so check wordpress.org before assuming it shipped. The RC3 announcement is clear about where it belongs: "Please do not install, run, or test this version of WordPress on production or mission-critical websites."

On staging only, this WP-CLI command from the RC3 announcement updates WordPress to the third release candidate.

wp core update --version=7.2-RC3

Run wp core version again and you should see a 7.2 release candidate. If you prefer the dashboard, the RC3 post describes the WordPress Beta Tester plugin: choose the "Bleeding edge" channel and the "Beta/RC Only" stream. The WordPress 7.2 readiness plan covers the release week in detail.

Once 7.2 final is out, update staging to the final release and repeat your checks.

Step 3: Scan your plugins and theme for the risky functions

This step answers the question from the top of the page. You search the code on your server for the functions PHP 8.6 deprecates. It takes seconds and changes nothing.

Go to your WordPress folder first. This command moves into it; replace the path with yours.

cd /home/username/public_html

This command searches every PHP file in your plugins folder for spl_object_hash and prints the file name and line number of each hit.

grep -rn --include="*.php" "spl_object_hash" wp-content/plugins/

Each hit looks like wp-content/plugins/plugin-name/file.php:42: plus the line of code. No output means no plugin uses it.

That list can be long, so this command shows only which plugins match any of the main PHP 8.6 deprecations, with a count of matching files per plugin.

grep -rlE --include="*.php" "spl_object_hash|mb_ereg|mb_split|mb_regex|is_double|is_long|is_integer|doubleval|strcoll|SORT_LOCALE_STRING" wp-content/plugins/ | cut -d/ -f3 | sort | uniq -c

You should see lines like 3 plugin-name, meaning three files in that plugin matched. Here -l prints file names only and -E allows the | "or" pattern.

To check your themes as well, run the same command again with wp-content/themes/ in place of wp-content/plugins/.

Heads up: a match is a lead, not a verdict. The plugin may only call the function on old PHP versions, or inside a check like function_exists(). A short word such as is_long could also match a longer custom name. When you search for those short aliases on their own, add -w to match whole words only, which the GNU grep manual describes as "Select only those lines containing matches that form whole words."

Now pair the scan with your plugin list. This command shows every active plugin with its version and whether an update is waiting, plus the PHP version each plugin says it requires.

wp plugin list --status=active --fields=name,version,update,requires_php

If a plugin that matched your scan shows available in the update column, update it on staging and scan again.

Step 4: Turn on the WordPress debug log on staging

The core post asks testers to run with WP_DEBUG and WP_DEBUG_LOG set to true. The debug log is a text file where WordPress writes every PHP notice, warning and error.

Back up wp-config.php before you edit it, but do not leave a secret-bearing copy in the web root. From the WordPress directory, this creates a private timestamped folder under your home directory and stores the copy there.

umask 077
backup_dir="$HOME/private-backups/php86-test-$(date +%F-%H%M%S)"
install -d -m 700 "$backup_dir"
cp -p wp-config.php "$backup_dir/wp-config.php"
printf 'Private backup: %s\n' "$backup_dir/wp-config.php"

Open wp-config.php and add these lines before the comment that says "That's all, stop editing!". They turn on debugging, write it to a file, and keep errors off the screen.

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

By default the log goes to wp-content/debug.log. That file can be read from the web on some setups, so keep debugging to staging and read how to use the debug log safely before you ever turn it on in production.

Step 5: Switch the staging site to PHP 8.6

If your host offers PHP 8.6, change the PHP version for the staging site only, using your host's PHP version selector. Every panel names this differently, so follow your host's documentation for the exact menu.

Before you switch, create or clear the old log so you only see new messages, then restrict it to the site owner. Run this only on the isolated staging copy.

umask 077
: > wp-content/debug.log
chmod 600 wp-content/debug.log

Debug logs can contain paths, submitted values and personal data. Do not paste the whole file into a public ticket; share only the necessary redacted lines.

After switching, reload Tools > Site Health > Info > Server and confirm it now reports PHP 8.6.

Step 6: Use the site like a real visitor

Notices only appear when the code runs, so a checkout plugin stays silent until you check out.

Work through your list: log in, publish a post, upload an image, submit each form, place a test order, open your main plugin settings pages. This command shows new lines as they are written; press Ctrl+C to stop.

tail -f wp-content/debug.log

How to read what the log tells you

Each line in debug.log starts with a date in brackets, then a label that tells you how worried to be.

  • PHP Deprecated: means the code still works but uses something that is going away. Note it and report it to the plugin author.
  • PHP Warning: means something went wrong, but PHP carried on. Check whether the feature still did its job.
  • PHP Fatal error: means the request stopped. Something on that page broke, and this is the one to act on now.

Here is a made-up example of what you might see after a short test. The format matches how PHP writes log lines; the exact wording PHP 8.6 uses may differ slightly, and the plugin name is invented.

[30-Nov-2026 09:12:04 UTC] PHP Deprecated:  Function spl_object_hash() is deprecated in /home/username/public_html/wp-content/plugins/example-cache/src/Registry.php on line 88
[30-Nov-2026 09:12:04 UTC] PHP Deprecated:  Function mb_ereg_replace() is deprecated in /home/username/public_html/wp-content/plugins/example-forms/inc/clean.php on line 31

The path tells you who owns the problem: a folder under wp-content/plugins/ is a plugin, one under wp-content/themes/ is your theme. The file and line number are exactly what a developer needs.

Imagine, as an invented example, a small bakery site with 18 plugins. The scan finds spl_object_hash in two of them. On PHP 8.6 staging the log fills with deprecation lines from both, yet every page works and the test order goes through. An update clears one plugin's notices; the owner reports the other to its author and keeps production on its current PHP for now. That is a normal outcome.

Deciding when to switch production

The official sources only say to confirm compatibility first, so this part is a judgment call. My recommendation: test on staging now, and move production only when every item below is true.

  • WordPress 7.2 final (not a release candidate) is installed on production.
  • Your host offers PHP 8.6 for production sites.
  • Staging ran on PHP 8.6 with all your key actions tested, and the log shows no PHP Fatal error: lines.
  • Any warnings in the log have been explained and do not affect a feature you rely on.
  • Plugins that matched the scan are updated, or you accept their deprecation notices for now.
  • You have a fresh backup and know how to switch PHP back in your panel.

Deprecation notices alone are no reason to wait forever, because the code still runs on 8.6. They are a reason to nudge plugin authors before a later version removes those functions. If you are still on PHP 8.2, note that its security support ends on 31 December 2026, and the PHP version guide for 2027 compares the safer options.

Quick tip: switch production at a quiet hour and recheck Site Health straight after.

When testing ends, set WP_DEBUG, WP_DEBUG_LOG and WP_DEBUG_DISPLAY back to false, remove wp-content/debug.log, and confirm the staging site still cannot send real customer email, charge real payments or call production webhooks. Keep the private wp-config.php backup only as long as your rollback window requires.

How to check it worked

Run these checks on staging after the switch, and again on production if you move it.

  • Tools > Site Health > Info > Server shows PHP 8.6.
  • wp core version prints 7.2 or later.
  • The grep scan from Step 3 returns fewer plugins after updates, or only ones you have reported.
  • Uploading a JPEG and a PNG to the Media Library works, and the thumbnails appear.
  • Your forms, login and checkout complete without errors on screen.

Last, confirm the log has no PHP Fatal error: lines. This command counts them, and the expected result is 0.

grep -c "PHP Fatal error" wp-content/debug.log

Troubleshooting

Image uploads fail with image_save_error

Symptom: uploads or image edits fail on PHP 8.6 with image_save_error. Likely cause: the core post explains that "PHP treats a userspace stream wrapper with no stream_flush() method as a failed flush, even when every byte was written." Plugins that save files to remote storage sometimes use a stream wrapper. Fix: update that plugin; if no fix exists, the developer needs to add a stream_flush() method, and the post's advice is "If there is nothing to flush, return true."

The log is full of spl_object_hash notices

Symptom: many PHP Deprecated: lines naming spl_object_hash(). Cause: a plugin or theme still uses the old function. Fix: update it, then report the file and line to the author. Tell them the WordPress post's warning too: spl_object_id() "returns an int rather than a 32-character string", so code that stores or compares the old value needs care.

Custom fonts are rejected

Symptom: a font upload or font check fails on PHP 8.6. Cause: the core post says "font/ttf will be used for valid TTF files instead" of font/sfnt, and code that only accepts font/sfnt will reject them. WordPress 7.2 accepts both. Fix: update the plugin or theme, or ask its developer to accept font/ttf as well.

"There has been a critical error on this website"

Symptom: a page or the whole staging site shows the critical error message. Cause: a PHP Fatal error: in the log, for example an uncaught ValueError from a function that is now stricter. Fix: read the last lines of debug.log to find the plugin path, then deactivate that plugin. This command deactivates one plugin by its folder name.

wp plugin deactivate plugin-name

If you cannot get in at all, switch staging back to its previous PHP version in your panel, then investigate.

Users keep getting logged out of a custom area

Symptom: a members area or cart that uses PHP sessions loses its data. Possible cause: PHP 8.6 turns on session.use_strict_mode and session.cookie_httponly and sets session.cookie_samesite to Lax by default. Fix: note which plugin handles that area and report it with the log lines; do not weaken these security settings on production to hide the problem.

No debug.log file appears

Symptom: you tested for a while and wp-content/debug.log does not exist. Cause: the define() lines were placed after the "stop editing" comment, or the web server cannot write to wp-content. Fix: move the lines above that comment and ask your host about write permissions. An empty log after real testing can also just mean good news.

WP-CLI and Site Health show different PHP versions

Symptom: wp cli info says one version, Site Health says another. Cause: the command line and the website use separate PHP binaries. Fix: trust Site Health for what visitors get, and ask your host how to run WP-CLI with the matching version.

If a fatal error points at a custom plugin or theme with no author to report to, hand the exact log line to a developer. If you find a bug in WordPress itself on PHP 8.6, the core post asks you to open "a Trac ticket with the php86 keyword" on WordPress Trac.

The one message worth forwarding

Copy this to your developer, agency or whoever manages your site:

Hi, PHP 8.6 was released on 19 November 2026 and WordPress 7.2 (scheduled for 8 December 2026) supports it. Before we move production, can you please: 1) set up our staging site on WordPress 7.2 and PHP 8.6, 2) run grep -rlE --include="*.php" "spl_object_hash|mb_ereg|mb_split|is_long|is_double|is_integer|doubleval|strcoll|SORT_LOCALE_STRING" wp-content/plugins/ wp-content/themes/ and tell me which plugins match, 3) test login, forms, uploads and checkout with WP_DEBUG_LOG on, and 4) send me any "PHP Fatal error" or "PHP Warning" lines from debug.log. We only switch production when there are no fatal errors and our key pages work. Thanks.

PHP 8.6 rewards the site owner who spends one quiet hour on staging, because the scan and the log tell you exactly which plugins need attention before your visitors ever notice.

Reader questions

Will PHP 8.6 break my WordPress site?

Deprecations in PHP 8.6 produce notices in the log and do not stop code from running. Some behaviour changes, such as functions that now return false or throw a ValueError, can cause real errors, which is why you test on staging first.

Which WordPress version do I need for PHP 8.6?

WordPress 7.2 or later. The WordPress core team says 7.2 is fully compatible with PHP 8.6 as of Beta 5, and support for new PHP versions is not backported to older WordPress branches.

Does WordPress 7.2 force me to upgrade PHP?

No. WordPress 7.2 keeps the minimum supported PHP version at 7.4, so moving to PHP 8.6 is your choice.

How long will PHP 8.6 be supported?

According to php.net, PHP 8.6 has active support until 31 December 2028 and security support until 31 December 2030.

What should I use instead of spl_object_hash()?

PHP recommends spl_object_id(). It returns an integer rather than a 32 character string, so code that stores or compares the old value may need changes.

My host does not offer PHP 8.6 yet. What can I do now?

You can still scan your plugins and theme for the deprecated functions with grep and update or report the ones that match. Ask your host when PHP 8.6 will be available, and test on staging once it is.

Sources & further reading

  1. PHP 8.6 release announcement
  2. PHP supported versions
  3. PHP manual: Deprecated features in PHP 8.6
  4. Make WordPress Core: WordPress and PHP 8.6
  5. WordPress 7.2 Release Candidate 3
  6. WP-CLI: wp plugin list
  7. WP-CLI: wp plugin deactivate
  8. Debugging in WordPress
  9. GNU grep manual
  10. WordPress Site Health screen

What changed

Safety correction: required an isolated staging database and disabled production side effects, moved the wp-config.php backup outside the web root, restricted and cleaned up debug.log, and added original media and prerequisites. Slug and original publication date preserved.

Originally published . About our editorial updates.

Your next project deserves a better foundation.

Explore hosting built for your next chapter.

Explore hosting

Find your next answer.

Search published guides and articles.

Ctrl / ⌘ K to open · Esc to close