ID: 32507
Updated by: [EMAIL PROTECTED]
Reported By: soletan at toxa dot de
Status: Open
Bug Type: Class/Object related
Operating System: Linux
PHP Version: 5.0.3
New Comment:
This is just another reincarnation of bug #30934.
Previous Comments:
------------------------------------------------------------------------
[2005-03-30 17:51:53] soletan at toxa dot de
Description:
------------
This report is a sequel to BUG #31943 and is in relation to BUG #32506
(posted by myself) most probably.
BUG #31943 was "solved" by reporter without a more detailed note, but
nevertheless I think there's a misinterpretation of how and why
abstract and static might be combined in an OOP-like system.
Or it is caused by non-virtual resolution of scope-reference self::...
- then it is identical to BUG #32506.
Is it bad OOP to have constellations like this code below? Or is it
just because of PHP5 not supporting virtual references? Well, in that
case I prefer to have it on the wish list.
Best Regards,
Thomas Urban
Reproduce code:
---------------
abstract class a {
static function test() {
echo self::read();
}
abstract protected static function read();
}
class b extends a {
protected static function read() {
return "hello world!";
}
}
b::test();
Expected result:
----------------
hello world!
Actual result:
--------------
Fatal error: Cannot call abstract method base::read() in ...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32507&edit=1