|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30230 exception handler not working with objects
Submitted: 2004-09-25 17:02 UTC Modified: 2004-10-13 00:34 UTC
From: auroraeosrose at hotmail dot com Assigned: helly (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.2 OS: *
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: auroraeosrose at hotmail dot com
New email:
PHP Version: OS:


 [2004-09-25 17:02 UTC] auroraeosrose at hotmail dot com
this is the 5.0 cvs snapshots NOT the 5.1 cvs snapshots

set_exception_handler(array($object, 'method')); or even set_exception_handler(array('Class', 'method')); does not work, setting just a function does set_exception_handler('function);

Reproduce code:
class dog {
function bug($exception)
$dog = new dog();
set_exception_handler(array($dog, 'bug'));
throw new Exception('doggy');

Expected result:
Fatal error: Uncaught exception 'Exception' with message 'doggy' in [removed]:10 Stack trace: #0 {main} thrown in [removed] on line 10

Actual result:
object(Exception)#1 (6) {
  string(5) "doggy"
  string(0) ""
  string(45) "[removed]"
  array(0) {


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-25 17:03 UTC] auroraeosrose at hotmail dot com
oops, expected and actual are flipped, sorry
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Feb 29 04:01:28 2020 UTC