Find the PHP problems a code scan can’t see: notices that only appear on real visits
Short answer
A code check reads what the code says, not the values it gets while the site runs. Messages such as “Passing null to parameter … is deprecated” or “Using null as an array offset is deprecated” depend on those values, so they only show up on real visits. The free way is to watch the error log after switching. CompatNav Pro, launching on 31 October 2026, adds a runtime logger (opt-in, 1 to 30 days): it counts what PHP reports during real requests, per plugin and theme, and marks the places the scan found too.
Problems that live in the values
A code check reads the code. Some PHP changes concern what the code receives. PHP 8.1, for example, deprecated passing null to built-in functions: “Scalar types for built-in functions are nullable by default. This behaviour is deprecated to align with the behaviour of user-defined functions, where scalar types need to be marked as nullable explicitly.” (php.net) Whether a given call passes null depends on your data.
The guides on this site mark these cases: passing null to parameter, null as an array key from a value, count() on something that isn’t a list, false turned into an array. In each, the scan of the example finds nothing, and the log does.
The free way: the error log
- Keep a log that visitors can’t see: the WordPress debug log shows how.
- Switch PHP on a staging copy, or on the live site after the code check.
- Read the log for a few days, and use the site: the pages, forms and admin screens that matter.
- Group the messages by plugin: the folder after
wp-content/plugins/names it.
It works. On busy sites the log gets long, and grouping by plugin is manual work.
With CompatNav Pro: the runtime logger
CompatNav Pro, launching on 31 October 2026, adds runtime notices (opt-in, off by default). For a window of 1 to 30 days, then it stops by itself, it counts the deprecations, warnings and notices PHP reports during the site’s real requests, per plugin and theme, and marks the places the scan found too. It never changes how your site shows or logs errors. It works best on a staging copy that already runs your target PHP version, or right after a switch.
On a test site with popular plugins, it found 6 places of a PHP 8.5 change that no code rule can detect.
What it costs and keeps, measured and published:
- 0.07 ms per request (median); visitors’ pages byte-identical with the capture on and off.
- Stored only in the site’s own database: the kind of message with values removed, file and line, plugin or theme, how often and when. Never web addresses, form data, users, IP addresses or cookies.
- Deleted 30 days after the capture ends, at once on request, and on uninstall.
The complete list of what Pro stores and sends: what leaves your site.
Key takeaways
- Some PHP messages depend on values, not code: no scan can see them in advance.
- Typical ones: passing
nullto PHP functions (8.1),nullas an array key at run time (8.5),count()on something that isn’t a list (8.0). - Free: keep a log that visitors can’t see, and read it for a few days after switching.
- CompatNav Pro’s runtime logger counts what PHP reports on real requests, per plugin and theme, for 1–30 days, then stops.
- Measured cost: 0.07 ms per request; visitors’ pages stay byte-identical; no URLs, users or IP addresses kept.
Frequently asked questions
Why can’t a scanner find these problems?
Because the same line is fine or not depending on the value: strlen($title) is correct when $title is text and gives a notice when it’s null. Only the running site knows which.
Does the runtime logger slow the site down?
It was measured at 0.07 ms per request (median), and visitors’ pages were byte-identical with the capture on and off.
What does it store?
Only in the site’s own database: the kind of message with values removed, the file and line, the plugin or theme, how often and when. Never web addresses, form data, users, IP addresses or cookies. It is deleted 30 days after the capture ends, or at once with Delete all captured results now.
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.
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.