From: reckert at informationsgesellschaft dot com
Operating system: Windows XP
PHP version: 5CVS-2004-01-16 (dev)
PHP Bug Type: Zend Engine 2 problem
Bug description: Inheritance of static functions
Description:
------------
In a static function X a call to another static function in the same class
uses the version of the function in the class where X is implemented, not
the one for which X was called for.
Reproduce code:
---------------
class a {
static function init() {
echo 'a::init()';
}
static function callInit() {
self::init();
// do something important
}
}
class b extends a {
static function init() {
echo 'b::init()';
}
}
b::callInit();
Expected result:
----------------
b::init()
Actual result:
--------------
a::init()
Shouldn't inheritance work the same way as for normal methods?
Thanks for comments,
Ralph
--
Edit bug report at http://bugs.php.net/?id=26930&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26930&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26930&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26930&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26930&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26930&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=26930&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=26930&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26930&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26930&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26930&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26930&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26930&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26930&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26930&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26930&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26930&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26930&r=float