|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-10 05:38 UTC] curt@php.net
[2004-09-18 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 09:00:02 2025 UTC |
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 />