note 70126 deleted from function.error-reporting by cmb
| From: | cmb@php.net | Date: | Sun, 08 Dec 2019 11:10:43 +0000 |
| Subject: | note 70126 deleted from function.error-reporting by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213442@lists.php.net to get a copy of this message | ||
Note Submitter: silvan at NOSPAM dot example dot com
----
On a shared debugging and production server it is convenient to use
<?php error_reporting(E_ALL); ?>
for debugging.
This will not help in case of parsing errors, so make sure you enable at least E_PARSE in your
php.ini. Parse errors should not exist in production scripts.
Still, sometimes your script will not get executed even though no parse error is displayed (just a
blank page/ no output at all). As far as I know this only happens when you redeclare a user function
or class.
eg.
<?php
error_reporting(E_ALL);
function a(){}
function a(){}
?>
This prevents your script from running like a parse error, but is in fact a fatal run-time error
(E_ERROR). Other fatal run-time errors will allow your script to apply the error_reporting, when it
is executed before the
error occurs (eg. put error_reporting on the first line of code.)