PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » PEAR » PEAR » Bug #2618

PEAR_ErrorStack::staticPopCallback does not return a value

Details

Submitted2004-10-26 07:42 UTC
Frommlmlml at lily dot freemail dot ne dot jp
Assignedcellog
StatusClosed
PackagePEAR
PHP Version4.3.9
OSredhat 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.