How to display PHP script errors?
Programming PHP is no easy task and might easily result into minor flaws or bugs which will affect your script’s functionality. Detecting these errors might be a hard task, unless you have chosen to display your PHP script errors. PHP allows errors to be displayed level-wise via your browser. In order to display errors one should make use of the error_reporting() function. Find below an overview of the different constants and the corresponding level.
1 | E_ERROR |
2 | E_WARNING |
4 | E_PARSE |
8 | E_NOTICE |
16 | E_CORE_ERROR |
32 | E_CORE_WARNING |
64 | E_COMPILE_ERROR |
128 | E_COMPILE_WARNING |
256 | E_USER_ERROR |
512 | E_USER_WARNING |
1024 | E_USER_NOTICE |
2048 | E_STRICT |
4096 | E_RECOVERABLE_ERROR |
8191 | E_ALL |