Testing PHP 8.1 on WP 6.1.x

Right now, despite PHP 8.1 is only one release up from the lowest supported version PHP WP Core ( at 6.1.x and 6.2 alpha ) has deprecation notices.

Although deprecation notices are not an issue, unless you are actively developing, like I do with my plugins.

I like to have WP Debug on and displaying warnings and notices, but these unavoidable deprecation notices are a pain.

Unfortunately I can find no way to adjust this early enough, but have found that creating an mu-plugin will deal with them ( although for some reason I still get a little extra line in wp-admin )

It is not ideal however I have to live with it for now.

( I have looked at some of them and looked at wp trac and it seems that there is a lot of it and as it doesn’t impact production no one is overly bothered, but as the trac tickets are so many and so long I would personally have no idea how to help with resolution )

<?php if (version_compare(PHP_VERSION, '8.1.0') >= 0) {
     error_reporting(E_ALL & ~E_DEPRECATED);

If you have better ways of dealing with this then please let me know.






Leave a Reply

Your email address will not be published. Required fields are marked *