|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-01-12 15:07 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 18:00:01 2025 UTC |
On my setup using PHP 5.3.1, this code: <?php function myErrorHandler($errno, $errstr, $errfile, $errline) { var_dump(error_reporting()); } set_error_handler('myErrorHandler', E_ALL); var_dump(error_reporting()); @include 'does-not-exist.php'; var_dump(error_reporting()); ?> Produces the following output: int(32767) int(0) int(0) int(32767) It is your own responsibility to check the error handling level inside your custom error handler.