From: tater at potatoe dot com Operating system: OS X 10.2 PHP version: 5CVS-2003-08-11 (dev) PHP Bug Type: Zend Engine 2 problem Bug description: call_user_func issues warning if function throws exception
Description: ------------ Throwing an exception from a function called by call_user_func() causes a warning to be issued, saying it was unable to call the function. An odd side note: if I set up my own error handler, it does not receive this warning. Kind of an inadvertant workaround for now... Reproduce code: --------------- function bar($x='no argument') { throw new Exception("This is an exception from bar({$x})."); } try { bar('first try'); } catch (Exception $e) { print "{$e->message}\n"; } try { call_user_func('bar','second try'); } catch (Exception $e) { print "{$e->message}\n"; } Expected result: ---------------- This is an exception from bar(first try). This is an exception from bar(second try). Actual result: -------------- This is an exception from bar(first try). Warning: call_user_func(bar): Unable to call bar(second try) in /my/pathname/test.php on line 8 This is an exception from bar(second try). -- Edit bug report at http://bugs.php.net/?id=25038&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25038&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25038&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25038&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25038&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25038&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25038&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25038&r=support Expected behavior: http://bugs.php.net/fix.php?id=25038&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25038&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25038&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25038&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25038&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25038&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25038&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25038&r=gnused