#32507 [Opn->Bgs]: continued: abstract static functions cause error on invocation

From: Date: Wed, 30 Mar 2005 21:48:50 +0000
Subject: #32507 [Opn->Bgs]: continued: abstract static functions cause error on invocation
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-77065@lists.php.net to get a copy of this message
ID: 32507 Updated by: sniper@php.net Reported By: soletan at toxa dot de -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Linux PHP Version: 5.0.3 New Comment: Please don't submit more bug reports about already reported issues. Previous Comments: ------------------------------------------------------------------------ [2005-03-30 18:03:49] tony2001@php.net This is just another reincarnation of bug #30934. ------------------------------------------------------------------------ [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

« previous php.bugs (#77065) next »