#29312 [Fbk->NoF]: set_exception_handler does not work correctly
| From: | php-bugs at lists dot php dot net | Date: | Fri, 17 Sep 2004 23:00:06 +0000 |
| Subject: | #29312 [Fbk->NoF]: set_exception_handler does not work correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66366@lists.php.net to get a copy of this message | ||
ID: 29312
Updated by: php-bugs@lists.php.net
Reported By: davey@php.net
-Status: Feedback
+Status: No Feedback
Bug Type: Zend Engine 2 problem
Operating System: WinXP w/SP1
PHP Version: 5.0.0
New Comment:
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".
Previous Comments:
------------------------------------------------------------------------
[2004-09-10 05:38:28] curt@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
------------------------------------------------------------------------
[2004-07-22 00:09:34] davey@php.net
Description:
------------
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:
---------------
<?php
class exception_handler {
function handle_exception($exception) {
var_dump($exception);
}
}
$exception_handler = new exception_handler;
set_exception_handler(array($exception_handler, 'handle_exception'));
throw new Exception;
?>
Expected result:
----------------
object(Exception)#1 (6) {
["message:protected"]=>
string(0) ""
["string:private"]=>
string(0) ""
["code:protected"]=>
int(0)
["file:protected"]=>
string(53) "D:\web\php-mag\shafikdavey_errorhandling\listing2.txt"
["line:protected"]=>
int(12)
["trace:private"]=>
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 />
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29312&edit=1