From: [EMAIL PROTECTED]
Operating system: WinXP w/SP1
PHP version: 5.0.0
PHP Bug Type: Zend Engine 2 problem
Bug description: set_exception_handler does not work correctly
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 bug report at http://bugs.php.net/?id=29312&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29312&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29312&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29312&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29312&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29312&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29312&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29312&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29312&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29312&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29312&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29312&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29312&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29312&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29312&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29312&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29312&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29312&r=float