note 64162 deleted from ref.errorfunc by mazzanet
| From: | mazzanet@php.net | Date: | Sun, 09 Apr 2006 08:04:26 +0000 |
| Subject: | note 64162 deleted from ref.errorfunc by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-107593@lists.php.net to get a copy of this message | ||
Note Submitter: NOSPAM at ejdude dot com
----
You may use this function in conjunction with your own error handler to determine if the triggered
error should be reported or not:
<?php
// bool is_reported( int errno )
// Returns TRUE if the given error number will be reported
function is_reported( $errno )
{
$level = error_reporting();
// PHP 5 fix -- E_STRICT = 2048
if( $level == 2048 )
{
return true;
}
// Bitwise comparison
return (bool) (( $level & $errno ));
}
?>
Keep in mind that calling a function with @ will temporarily set the error reporting level to zero.