PEAR is archived and read-only

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

Home » PEAR » PEAR » Bug #1395

PEAR_ErrorStack::staticCallback needs to instantiate the stack

Details

Submitted2004-05-12 21:42 UTC
Fromsean at caedmon dot net
Assignedcellog
StatusClosed
PackagePEAR
PHP Version4.3.6
OSLinux
Roadmaps(Not assigned)

Comments

[2004-05-12 21:42 UTC] sean at caedmon dot net

Description:
------------
PEAR_ErrorStack::staticCallback/staticPush does not actually implement the callback unless the stack has been instanciated.

(This was posted on the dev list, here http://news.php.net/article.php?group=php.pear.dev&article=29151 )

Greg also posted an interim solution, here: http://news.php.net/article.php?group=php.pear.dev&article=29163

S

Reproduce code:
---------------
<?php
require_once('PEAR.php');
require_once('PEAR/ErrorStack.php');

function static_callback()
{
echo "static_callback(...) called.\n";
print_r(func_get_args());
}

PEAR_ErrorStack::staticPushCallback('static_callback');
PEAR_ErrorStack::staticPush('teststack', 100, 'error', array('test' =>
'testing'), 'test error -- testing callback');

// static_callback() is never called

?>