|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22659 set_error_handler("foo") doesn't care if foo exists
Submitted: 2003-03-12 10:13 UTC Modified: 2003-03-12 19:20 UTC
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: steil at zweitwerk dot com Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.3.2RC1 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: steil at zweitwerk dot com
New email:
PHP Version: OS:


 [2003-03-12 10:13 UTC] steil at zweitwerk dot com
What I mean is the following

    // first call returns nothing
    $ret1 = set_error_handler("unknown_function");

    // second call returns "unknown_function"
    $ret2 = set_error_handler("another_unknown_function");

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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-12 16:59 UTC]
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 19:20 UTC]
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();
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Aug 16 13:05:43 2022 UTC