svn: /phpdoc/en/trunk/reference/errorfunc/functions/ set-error-handler.xml
| From: | Daniel Egeberg | Date: | Sun, 25 Jul 2010 11:20:19 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/errorfunc/functions/ set-error-handler.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-6915@lists.php.net to get a copy of this message | ||
degeberg Sun, 25 Jul 2010 11:20:19 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=301531
Log:
Improved example in set_error_handler(). Fixes PHP bug #52338.
Bug: http://bugs.php.net/52338 (Open) Handeling @ supressed
errors in custom error handlers
Changed paths:
U phpdoc/en/trunk/reference/errorfunc/functions/set-error-handler.xml
Modified: phpdoc/en/trunk/reference/errorfunc/functions/set-error-handler.xml
===================================================================
--- phpdoc/en/trunk/reference/errorfunc/functions/set-error-handler.xml 2010-07-25 11:12:19 UTC (rev
301530)
+++ phpdoc/en/trunk/reference/errorfunc/functions/set-error-handler.xml 2010-07-25 11:20:19 UTC (rev
301531)
@@ -230,6 +230,11 @@
// error handler function
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
+ if (!(error_reporting() & $errno)) {
+ // This error code is not included in error_reporting
+ return;
+ }
+
switch ($errno) {
case E_USER_ERROR:
echo "<b>My ERROR</b> [$errno] $errstr<br />\n";