Home » PEAR » PEAR » Bug #293
[Patch] PEAR_Error not calling static method callbacks for error-handler
Details
| Submitted | 2003-11-25 12:26 UTC |
|---|---|
| From | alan at caint dot com |
| Assigned | cellog |
| Status | Closed |
| Package | PEAR |
| PHP Version | Irrelevant |
| OS | N/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
======