Bug #16570 Updated: error control operator and set_error_handler()
| From: | alberty at neptunelabs dot de | Date: | Sat, 13 Apr 2002 13:29:15 +0000 |
| Subject: | Bug #16570 Updated: error control operator and set_error_handler() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-4888@lists.php.net to get a copy of this message | ||
ID: 16570
Updated by: alberty@neptunelabs.de
Reported By: alberty@neptunelabs.de
-Status: Bogus
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: i686-pc-linux-gnu
PHP Version: 4.0CVS-2002-04-12
New Comment:
sorry, my mistake.
Previous Comments:
------------------------------------------------------------------------
[2002-04-12 17:08:33] sniper@php.net
Not a bug. If @ is used, error_reporting is set to 0.
You need to take care of it yourself in your error handler
function if you don't want to show errors in that case.
This is done this way to let users have as much control
as possible in their own error handlers.
And it is documented here:
http://www.php.net/manual/en/function.set-error-handler.php
--Jani
------------------------------------------------------------------------
[2002-04-12 12:49:16] alberty@neptunelabs.de
Hi,
the @ Error Control Operator doesnt suppress warnings
(e.g.:E_WARNING),
if an own error handler is declared.
the follow code snip demonstrate the problem:
<?php
error_reporting(E_ALL);
function error_handler ($errno, $errstr, $errfile, $errline) {
echo "$errstr <br>in $errfile<br>line $errline<br>";
}
$old_error_handler = set_error_handler('error_handler');
$dbconnect=@mysql_pconnect('foobar-server', 'bart', 'simson');
?>
I think this is a bug, because this behavior is not documented.
Regards,
Steve
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16570&edit=1