|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29312 set_exception_handler does not work correctly
Submitted: 2004-07-22 00:09 UTC Modified: 2004-09-18 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5.0.0 OS: WinXP w/SP1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2004-07-22 00:09 UTC]
When supplying an object/method callback for set_exception_handler it does not work if no exception message is passed. If you use a function of a static method it works fine.

If you pass a message, it also works as expected

- Davey

Reproduce code:
class exception_handler {
    function handle_exception($exception) {

$exception_handler = new exception_handler;

set_exception_handler(array($exception_handler, 'handle_exception'));

throw new Exception;


Expected result:
object(Exception)#1 (6) {
  string(0) ""
  string(0) ""
  string(53) "D:\web\php-mag\shafikdavey_errorhandling\listing2.txt"
  array(0) {

Actual result:
<br />
<b>Fatal error</b>:  Uncaught exception 'Exception' in D:\web\php-mag\shafikdavey_errorhandling\listing2.txt:12
Stack trace:
#0 {main}
  thrown in <b>D:\web\php-mag\shafikdavey_errorhandling\listing2.txt</b> on line <b>12</b><br />


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-10 05:38 UTC]
Please try using this CVS snapshot:
For Windows:
 [2004-09-18 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 22 04:01:31 2024 UTC