#24528 [NEW]: PEAR_Error() hides fatal error when the class method error handler called
| From: | akimoto at share360 dot com | Date: | Tue, 08 Jul 2003 05:37:44 +0000 |
| Subject: | #24528 [NEW]: PEAR_Error() hides fatal error when the class method error handler called | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-18078@lists.php.net to get a copy of this message | ||
From: akimoto at share360 dot com
Operating system: Windows XP pro
PHP version: 4.3.3RC1
PHP Bug Type: PEAR related
Bug description: PEAR_Error() hides fatal error when the class method error handler called
Description:
------------
When you set PEAR error handler with object's method, any fatal error
occuring in the handler does not show the fatal error message generated by
PHP, just dies instead.
Fatal error should be caught and recognized. This issue makes it very
difficult to chase PHP system level error.
PEAR.php line 768 (in 1.2b2)
@call_user_func($this->callback, $this);
should not have atmark.
Reproduce code:
---------------
<?php
require_once('PEAR.php');
class DummyForFatalError {
function DummyForFatalError(&$arg1) {}
}
class MyErrorHandler {
function handlerMethod() {
new DummyForFatalError(null); // cannot pass null as reference
parameter
}
}
$errorHandlerClass = new MyErrorHandler();
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(&$errorHandlerClass,
'handlerMethod'));
class MyPear extends PEAR {
function invokeError() {
PEAR::throwError(null, '123', 'userinfo');
}
}
MyPear::invokeError();
echo "End of script";
?>
Expected result:
----------------
Fatal error: Cannot pass parameter 1 by reference in C:\Program
Files\Apache Group\Apache2\htdocs\reproduce.php on line 8
Actual result:
--------------
blank page
--
Edit bug report at http://bugs.php.net/?id=24528&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24528&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24528&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=24528&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24528&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24528&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24528&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24528&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24528&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24528&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24528&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24528&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24528&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24528&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24528&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24528&r=gnused