php/doc-en

error_reporting(): additional info about set_error_handler function would be useful

Ouverte

#1 283 ouverte le 30 déc. 2021

 (0 commentaire) (0 réaction) (0 personne assignée)XML (882 forks)auto 404
Category: Engineenhancementgood first issue

Métriques du dépôt

Stars
 (596 étoiles)
Métriques de merge PR
 (Merge moyen 99j 23h) (90 PRs mergées en 30 j)

Description

What's not immediately clear from https://www.php.net/manual/en/function.error-reporting.php is that even if you set error_reporting to a specific value, if you also set a user-defined error handler function with set_error_handler, errror_reporting() settings will have no effect. On https://www.php.net/manual/en/function.set-error-handler this is mentioned ("error_reporting() settings will have no effect and your error handler will be called regardless - however you are still able to read the current value of error_reporting and act appropriately."). I think it would be valuable to add this information to https://www.php.net/manual/en/function.error-reporting.php (e.g. by adding it to the Notes section). I spent quite some time trying to understand why DEPRECATED errors were stopping my program flow, even though I had error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); set. It was only when I carefully read https://www.php.net/manual/en/function.set-error-handler that I realized my error_reporting setting was ignored.

Guide contributeur