Inspired from @anon71687268 's blog…
https://codepotent.com/improved-php-error-reporting-in-classicpress/
… I’ve mixed up things with a utility plugin I was using for debugging.
If someone is interested here there is the plugin:
I’m also interested in comments, I wrote it quickly…
Note: it’s not intended to be used on production sites.