Bug #16570 Updated: error control operator and set_error_handler()
| From: | sniper@php.net | Date: | Fri, 12 Apr 2002 21:08:34 +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-4780@lists.php.net to get a copy of this message | ||
ID: 16570
Updated by: sniper@php.net
Reported By: alberty@neptunelabs.de
-Status: Open
+Status: Bogus
-Bug Type: *Programming Data Structures
+Bug Type: Scripting Engine problem
Operating System: i686-pc-linux-gnu
PHP Version: 4.0CVS-2002-04-12
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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