Home » PEAR » PEAR » Bug #2618
PEAR_ErrorStack::staticPopCallback does not return a value
Details
| Submitted | 2004-10-26 07:42 UTC |
|---|---|
| From | mlmlml at lily dot freemail dot ne dot jp |
| Assigned | cellog |
| Status | Closed |
| Package | PEAR |
| PHP Version | 4.3.9 |
| OS | redhat linux 7.3 |
| Roadmaps | (Not assigned) |
Comments
[2004-10-26 07:42 UTC] mlmlml at lily dot freemail dot ne dot jp
Description:
------------
Using "PEAR_ErrorStack::staticPushCallback" will not work while using "pushCallback" of a PEAR_ErrorStack instance works fine.
I am guessing "PEAR_ErrorStack::staticPopCallback" is not returning anything although the document says that the function returns "array|string|false"
I found a simillar bug "Bug #1395 PEAR_ErrorStack::staticCallback needs to instantiate the stack," and I updated PEAR/ErrorStack.php (ErrorStack.php,v 1.13 2004/10/23 19:54:35). But it still seems to be not fixed. It reproduces the same result, explained on its bug page.
Reproduce code:
---------------
<?PHP
require_once('PEAR/ErrorStack.php');
function myCallback($err){
echo 'myCallback($err) was called';
}
//this callback doesn't work
PEAR_ErrorStack::staticPushCallback('myCallback');
PEAR_ErrorStack::staticPush('default', 1, 'error', null, 'testing PEAR_ErrorStack::staticPushCallback()');
//but this does
$defaultErrorStack =& PEAR_ErrorStack::singleton('default');
$defaultErrorStack->pushCallback('myCallback');
PEAR_ErrorStack::staticPush('default', 1, 'error', null, 'testing PEAR_ErrorStack::staticPushCallback()');
?>
Expected result:
----------------
Even for the PEAR_ErrorStack::staticPush, after it's been called the function "myCallback" should be called back.
Actual result:
--------------
nothing happens for the PEAR_ErrorStack::staticPush in the example.