#50729 [Opn->Bgs]: Error Control Operator (@) Does Not Work With Custom Error Handler
| From: | colder@php.net | Date: | Tue, 12 Jan 2010 15:12:49 +0000 |
| Subject: | #50729 [Opn->Bgs]: Error Control Operator (@) Does Not Work With Custom Error Handler | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-146575@lists.php.net to get a copy of this message | ||
ID: 50729
Updated by: colder@php.net
Reported By: keithdavis at solidtechservice dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Windows 7 64 Bit
PHP Version: 5.3.1
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
@ temporarily sets error_reporting to 0, it doesn't prevent your
handler
to be called. You've to do the filtering in it based on error_reporting
if you want to.
Previous Comments:
------------------------------------------------------------------------
[2010-01-12 15:07:12] keithdavis at solidtechservice dot com
Description:
------------
The @ is supposed to set error level to 0 (at least, I think that is
what it supposed to do), but that does not work with a custom error
handler. I can reproduce this every time.
Reproduce code:
---------------
Set error handler:
set_error_handler('ErrorHandler');
Code to generate error:
$this->_bind = @ldap_bind($this->_conn,
$this->_ad_username.$this->_account_suffix, $this->_ad_password);
Error Handler Test:
function ErrorHandler($iErrorNum, $sErrorMsg, $sErrorFile,
$iErrorLineNum){
echo $iErrorNum;
}
Expected result:
----------------
No error message and an $iErroNum of 0.
Actual result:
--------------
error message:
WARNING [2] ldap_bind(): Unable to bind to server: Can't contact LDAP
server, Line: 140 in file
C:\inetpub\Intranet_Local\library\classes\adLDAP.php
$iErrorNum = 1024
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50729&edit=1