#22659 [Ver->WFx]: set_error_handler("foo") doesn't care if foo exists
| From: | iliaa@php.net | Date: | Thu, 13 Mar 2003 01:20:29 +0000 |
| Subject: | #22659 [Ver->WFx]: set_error_handler("foo") doesn't care if foo exists | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-35477@lists.php.net to get a copy of this message | ||
ID: 22659
Updated by: iliaa@php.net
Reported By: steil at zweitwerk dot com
-Status: Verified
+Status: Wont fix
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.3.2RC1
New Comment:
Fixing this problem would require the code to check for the function's
existance when set_error_handler() is called. This also would mean that
the error handler would need to be declared in the PHP code BEFORE the
set_error_handler() tries to set that function as the error handler.
This behaviour change would break all of the scripts that declare
error_handler AFTER calling set_error_handler();
Previous Comments:
------------------------------------------------------------------------
[2003-03-12 16:59:23] sniper@php.net
It returns NULL for me. And this error message:
"Warning - set_error_handler() expects argument 1, 'unknown_function',
to be a valid callback"
------------------------------------------------------------------------
[2003-03-12 10:13:47] steil at zweitwerk dot com
What I mean is the following
<?php
// first call returns nothing
$ret1 = set_error_handler("unknown_function");
var_dump($ret1);
// second call returns "unknown_function"
$ret2 = set_error_handler("another_unknown_function");
var_dump($ret2);
?>
The documentation says set_error_handler() would return FALSE if an
error occurs. Therefore, both of the above calls should return FALSE
since setting the error handler to an unknown function is certainly an
error.
As a consequence I am not able to check if the call to
set_error_handler() has been successful.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22659&edit=1