Speed Optimizer on PHP 8.6: deprecation notices and the fix
On PHP 8.6 (due 19 November 2026), Speed Optimizer 7.8.5 logs a deprecation notice on every ordinary page load in our test. We found 1 place in its code that PHP 8.6 flags. Nothing stops working; the notices go to your PHP error log and show on pages where errors are displayed.
Tested on 28 October 2026 with the official PHP 8.6.0RC4 build and WordPress 7.1.1, plugin version 7.8.5 (1,000,000+ active installs) from WordPress.org, activated alone with default settings.
The messages you will see
Deprecated: Returning a value from a constructor is deprecated
Where they come from
| File:line | What | When PHP 8.6 complains | In our WordPress test |
|---|---|---|---|
core/Htaccess/Htaccess.php:85 | returns a value from a constructor | Compile time: logged when PHP loads the file | on every front-end page load |
The fix
Site owners: you don't need to change anything to keep the site working. Keep display_errors off on the live
site, and update Speed Optimizer when a release mentions PHP 8.6. If a notice shows on your pages, set
define( 'WP_DEBUG_DISPLAY', false ); in wp-config.php.
Plugin developers, line by line:
- returns a value from a constructor: Change
return โฆ;inside__construct()to a barereturn;.newalways returns the object, so the value was never used.
What a PHP 8.6 deprecation notice does, and what it doesn't
- Nothing stops working on PHP 8.6. A deprecation is a warning that the code will break in a future major version (PHP 9, no date yet). The plugin keeps working.
- It lands in your logs. With
log_errorson (the usual hosting default) every notice goes to the PHP error log, and withWP_DEBUG_LOGtowp-content/debug.log. - It can show on the page. If
display_errorsis on, orWP_DEBUGis on withoutWP_DEBUG_DISPLAYset to false, the notice is printed into the page. That breaks AJAX/JSON responses and can cause "headers already sent" warnings. Keep display off on live sites. - Compile-time notices are logged when PHP compiles the file. With OPcache that happens once after a restart or
cache reset, so you see a few lines, not one per visit. Function notices (
spl_object_hash(),is_integer()โฆ) are logged every time that code runs.
All 39 affected plugins out of the 100 most popular, and the 61 with no findings: PHP 8.6 and WordPress plugins.
Sources
- PHP 8.6 release schedule (GA 19 November 2026)
- php-src PHP-8.6 UPGRADING, section 4: Deprecated functionality
- RFC: Deprecations for PHP 8.6
- RFC: Deprecate returning a value from __construct()
- php.net pre-release builds (8.6.0RC4 used for this test)
- guzzlehttp/promises 2.6.0 / 3.1.0 changelog: Is deprecated, State added (18 October 2026)
- WordPress.org: popular plugins