Home » PEAR » PEAR » Bug #1395
PEAR_ErrorStack::staticCallback needs to instantiate the stack
Details
| Submitted | 2004-05-12 21:42 UTC |
|---|---|
| From | sean at caedmon dot net |
| Assigned | cellog |
| Status | Closed |
| Package | PEAR |
| PHP Version | 4.3.6 |
| OS | Linux |
| 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
?>