note 48956 deleted from function.error-reporting by didou
| From: | didou@php.net | Date: | Thu, 13 Jan 2005 12:40:10 +0000 |
| Subject: | note 48956 deleted from function.error-reporting by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-83186@lists.php.net to get a copy of this message | ||
Note Submitter:
Reason: useless example
----
The following note might save somebody for several hours of debugging:
error_reporting() might be tricky when used for scopes. E.g. if you include some third party module,
you might wan't to stop error reporting for this module but keep a restrictive policy for your
own code. Beware that the following (which seems like a natural solution) will NOT work:
<?
error_reporting(0); // Turning error_reporting off
require_once("thirdparty_module.php");
error_reporting(E_ALL); // Turning it on again
...
...
?>
You can suppress error reporting if the inclusion is done in the bottom of the file:
<?
...
...
error_reporting(0); // Turning error_reporting off
require_once("thirdparty_module.php");
?>
but if your script is beeing included into another file, this might not be a proper solution.
I have not yet found a way to restrict error reporting for only parts of the code.