|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24528 PEAR_Error() hides fatal error when the class method error handler called
Submitted: 2003-07-08 00:37 UTC Modified: 2003-07-10 06:36 UTC
From: akimoto at share360 dot com Assigned: cox (profile)
Status: Closed Package: PEAR related
PHP Version: 4.3.3RC1 OS: Windows XP pro
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
12 + 2 = ?
Subscribe to this entry?

 [2003-07-08 00:37 UTC] akimoto at share360 dot com
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:
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');
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-10 06:36 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 01 16:03:34 2021 UTC