A bunch of PHP 8.5.1 deprecation warnings on site startup

What issue or error are you experiencing?

When starting up a site on PHP 8.5.1, I get a fairly long stack trace (a few thousand lines worth) of deprecation warnings. I only see it happen on site startup or when toggling from an older version of PHP to 8.5.1. They appear to be originating from the app itself.

Example:

Summary

[01-Oct-2026 19:31:54 UTC] PHP Deprecated: Using null as an array offset is deprecated, use an empty string instead in phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/php-cli-tools/lib/cli/Colors.php on line 95

[01-Oct-2026 19:31:54 UTC] PHP Stack trace:

[01-Oct-2026 19:31:54 UTC] PHP 1. {main}() C:\Users\lcraft\AppData\Local\Programs\Local\resources\extraResources\bin\wp-cli\wp-cli.phar:0

[01-Oct-2026 19:31:54 UTC] PHP 2. include() C:\Users\lcraft\AppData\Local\Programs\Local\resources\extraResources\bin\wp-cli\wp-cli.phar:4

[01-Oct-2026 19:31:54 UTC] PHP 3. include() phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/php/boot-phar.php:20

[01-Oct-2026 19:31:54 UTC] PHP 4. WP_CLI\bootstrap() phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/wp-cli.php:35

[01-Oct-2026 19:31:54 UTC] PHP 5. WP_CLI\Bootstrap\LaunchRunner->process($state = class WP_CLI\Bootstrap\BootstrapState { private $state = [‘config’ => […], ‘arguments’ => […], ‘assoc_args’ => […], ‘context_manager’ => class WP_CLI\ContextManager { … }] }) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/bootstrap.php:84

[01-Oct-2026 19:31:54 UTC] PHP 6. WP_CLI\Runner->start() phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php:28

[01-Oct-2026 19:31:54 UTC] PHP 7. WP_CLI\Runner->run_command_and_exit($help_exit_warning = *uninitialized*) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1295

[01-Oct-2026 19:31:54 UTC] PHP 8. WP_CLI\Runner->run_command($args = [0 => ‘core’, 1 => ‘check-update’], $assoc_args = [‘field’ => ‘version’], $options = *uninitialized*) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:493

[01-Oct-2026 19:31:54 UTC] PHP 9. WP_CLI\Dispatcher\Subcommand->invoke($args = [], $assoc_args = [‘field’ => ‘version’], $extra_args = []) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:470

[01-Oct-2026 19:31:54 UTC] PHP 10. call_user_func:{phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:497}($callback = class Closure { public $name = ‘{closure:WP_CLI\\Dispatcher\\CommandFactory::create_subcommand():97}’; public $file = ‘phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php’; public $line = 97; public $static = [‘callable’ => […]]; public $parameter = [‘$args’ => ‘’, ‘$assoc_args’ => ‘’] }, …$args = variadic([‘field’ => ‘version’, ‘format’ => ‘table’])) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:497

[01-Oct-2026 19:31:54 UTC] PHP 11. WP_CLI\Dispatcher\CommandFactory::{closure:phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:97-104}($args = [], $assoc_args = [‘field’ => ‘version’, ‘format’ => ‘table’]) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:497

[01-Oct-2026 19:31:54 UTC] PHP 12. call_user_func:{phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:100}($callback = [0 => class Core_Command { }, 1 => ‘check_update’], …$args = variadic([‘field’ => ‘version’, ‘format’ => ‘table’])) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:100

[01-Oct-2026 19:31:54 UTC] PHP 13. Core_Command->check_update($_ = [], $assoc_args = [‘field’ => ‘version’, ‘format’ => ‘table’]) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:100

[01-Oct-2026 19:31:54 UTC] PHP 14. WP_CLI::success($message = ‘WordPress is at the latest version.’) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/core-command/src/Core_Command.php:92

[01-Oct-2026 19:31:54 UTC] PHP 15. WP_CLI\Loggers\Regular->success($message = ‘WordPress is at the latest version.’) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/class-wp-cli.php:800

[01-Oct-2026 19:31:54 UTC] PHP 16. WP_CLI\Loggers\Base->_line($message = ‘WordPress is at the latest version.’, $label = ‘Success’, $color = ‘%G’, $handle = *uninitialized*) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Loggers/Regular.php:34

[01-Oct-2026 19:31:54 UTC] PHP 17. cli\Colors::colorize($string = ‘%GSuccess:%n’, $colored = FALSE) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Loggers/Base.php:79

[01-Oct-2026 19:31:54 UTC] PHP 18. cli\Colors::cacheString($passed = ‘%GSuccess:%n’, $colorized = ‘Success:’, $deprecated = *uninitialized*) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/php-cli-tools/lib/cli/Colors.php:120

[01-Oct-2026 19:31:54 UTC] PHP 19. cli\Colors::decolorize($string = ‘%GSuccess:%n’, $keep = *uninitialized*) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/php-cli-tools/lib/cli/Colors.php:179

[01-Oct-2026 19:31:54 UTC] PHP 20. cli\Colors::color($color = [‘style’ => ‘bright’]) phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/php-cli-tools/lib/cli/Colors.php:161


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


I am just clicking “Start Site”. If there’s something specific you’d like me to adjust to debug, let me know.

System Details

  • Local Version: 10.1.2+7004

  • Operating System (OS) and OS version: Windows 11 Education, 25H2

    debug.log (1.3 MB)

  • local-logs.zip (1.6 MB)


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @lcraft! To confirm this is just a new, blank site you’re spinning up? Is the rest of the configuration customized in any way?

Or is this a site you already built or imported and are testing a PHP 8.5 version update?

Yep, to be clear, this is an already existing site. I was testing the site against PHP 8.5.1, yes. I don’t experience these deprecation notices on 8.4.16, for example. I am not sure if there’s any weird setup in any configuration files. I’d be happy to share any files to check against.

You might need to update your WP-CLI version @lcraft.

You could check it in Site Shell with wp --version and then run wp cli update. The current version should be 2.12.0.

It was already on 2.12.0 when I opened the site shell:

Summary

Setting Local environment variables…

WP-CLI: WP-CLI 2.12.0

PHP version 8.5.1 (C:\Users\lcraft\AppData\Roaming\Local\lightning-services\php-8.5.1+1\bin\win64\php.exe)
Run the “diagnose” command to get more detailed diagnostics output.
Composer: Deprecated: Case statements followed by a semicolon (:wink: are deprecated, use a colon (:slight_smile: instead in phar://C:/Users/lcraft/AppData/Local/Programs/Local/resources/extraResources/bin/composer/composer.phar/vendor/react/promise/src/functions.php on line 300
Composer: Composer version 2.8.6 2025-02-25 13:03:50
PHP: 8.5.1
MySQL: mysql Ver 8.0.35 for Win64 on x86_64 (MySQL Community Server - GPL)

Loaded Shell for Local Site: JWCC Foundation

C:\Users\lcraft\Local Sites\jwcc-foundation\app\public>

So running those commands produced no unusual result:

C:\Users\lcraft\Local Sites\jwcc-foundation\app\public>wp --version
WP-CLI 2.12.0

C:\Users\lcraft\Local Sites\jwcc-foundation\app\public>wp cli update
Success: WP-CLI is at the latest version.

@lcraft okay thanks for checking that!

I tested a new, blank site on PHP 8.5 but I’m not seeing any issues which leads me to believe it might be something else within the site’s configuration.

You could try disabling plugins or swapping the theme next to see if that gets rid of the warnings. There might be a conflict within one of those items and you could try to narrow it down that way. Are all of these items currently up to date to their latest versions? If all updates are done and the warnings are still persistent you could try disablement or replacement next to troubleshoot.

To disable all plugins at once in Site Shell you could run wp plugin deactivate --all and quick check if that resolves the warnings.

I deactivated every plugin and switched to a default theme (Twenty Twenty Five); it still produces those PHP deprecation notices. That doesn’t surprise me too much, because like I say, this happens at site startup, before I even load anything on the website. Here’s a short clip so it’s clear what’s going on: https://drive.google.com/file/d/1eBcJzmO0qrid2ynaIEyDh5sDKyWAKFHD/view?usp=sharing

To confirm from your end, if you create a new, blank site, do you see any of the same warnings upon site start? I couldn’t replicate on my side with PHP 8.5, but I want to make sure a clean install works the same for you.

If it does, is there anything else that might be different between your developed site and a blank one? Any custom code (wp-config.php), WP Network setup, or other configurations?

Otherwise, you could try disabling the deprecation warnings by inputting this in wp-config:

// Suppress PHP deprecation warnings
error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE);

Or logging them instead:

// Log deprecation warnings instead of displaying them
error_reporting(E_ALL);
ini_set(‘display_errors’, ‘0’);
ini_set(‘log_errors’, ‘1’);
ini_set(‘error_log’, WP_CONTENT_DIR . ‘/debug.log’);

I set up a fresh, blank site. I changed wp-config.php to have WP_DEBUG and WP_DEBUG_LOG to be true. Still doing the same thing for me on startup before I ever open the website (though the debug log has a less detailed stack trace). See attached.

debug.log (43.3 KB)

Also, just to make sure it’s clear, these deprecation notices are not actually being displayed on the frontend of the development site. They are only showing up in the debug log, and only on site startup. It’s not like this is slamming the debug log on every page refresh or something like that.

Thank you for the updates and context here @lcraft! I’ll check with our team on this. For now, if these are a nuisance, you could suppress them if you don’t want to see them each time on Site Start.