#30230 [Opn->Csd]: exception handler not working with objects

From: Date: Tue, 12 Oct 2004 22:34:57 +0000
Subject: #30230 [Opn->Csd]: exception handler not working with objects
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-67502@lists.php.net to get a copy of this message
ID: 30230 Updated by: helly@php.net Reported By: auroraeosrose at hotmail dot com -Status: Open +Status: Closed Bug Type: Zend Engine 2 problem -Operating System: Win XP Pro SP2 +Operating System: * -PHP Version: 5CVS-2004-09-25 (dev) +PHP Version: 5.0.2 -Assigned To: +Assigned To: helly Previous Comments: ------------------------------------------------------------------------ [2004-09-25 17:03:12] auroraeosrose at hotmail dot com oops, expected and actual are flipped, sorry ------------------------------------------------------------------------ [2004-09-25 17:02:15] auroraeosrose at hotmail dot com Description: ------------ 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) { var_dump($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) { ["message:protected"]=> string(5) "doggy" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(45) "[removed]" ["line:protected"]=> int(8) ["trace:private"]=> array(0) { } } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30230&edit=1

« previous php.bugs (#67502) next »