PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PEAR » PEAR » Bug #293

[Patch] PEAR_Error not calling static method callbacks for error-handler

Details

Submitted2003-11-25 12:26 UTC
Fromalan at caint dot com
Assignedcellog
StatusClosed
PackagePEAR
PHP VersionIrrelevant
OSN/A
Roadmaps(Not assigned)

Comments

[2003-11-25 12:26 UTC] alan at caint dot com

Description:
------------
If $this->callback is an array PEAR_Error only checks that the first
element is an object.

Patch uses is_callable() to check for valid callback.

See:
http://news.php.net/article.php?group=php.pear.dev&article=23777

Reproduce code:
---------------
<?php
class ErrHandler {
function handleStaticErr($error)
{
echo 'Static: '. $error->getMessage();
}
}

PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array('ErrHandler', 'handleStaticErr'));
PEAR::raiseError('Test Error');
?>

Expected result:
----------------
Output
======
Static: Test Error

Actual result:
--------------
Output
======