Bug #3973 [NEW]: Static methods are called using an instance of the object.
| From: | yasheshb at gmail dot com | Date: | Mon, 28 Mar 2005 04:41:46 +0000 |
| Subject: | Bug #3973 [NEW]: Static methods are called using an instance of the object. | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-5804@lists.php.net to get a copy of this message | ||
From: yasheshb at gmail dot com
Operating system: Fedora Core 2
PHP version: 5.0.3
Package: Documentation
Bug Type: Bug
Bug description: Static methods are called using an instance of the object.
Description:
------------
while going thru the documentation of PEAR_ErrorStack
http://pear.php.net/manual/en/core.pear.pear-errorstack.intro.php
in the second example an error stack is being setup for
the internal db package using the methodcall
// use the callback
$dbstack->setDefaultCallback(array(&$myobj, 'errorCallback'))
this is incorrect since looking at the documentation of the above method
http://pear.php.net/manual/en/core.pear.pear-errorstack.setdefaultcallback.php
it mentions clearly "PEAR_ErrorStack::setDefaultCallback() -- Sets a
default callback to be used by all error stacks"
hence the callback will be for all error stacks and not only for dbstack.
and secondly it is bad coding style to use an object to call a static
method.
"Note
This function should be called statically."
Thanks.
Regards.
Yashesh Bhatia.
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=3973&edit=1
--