From:             soletan at toxa dot de
Operating system: Linux
PHP version:      5.0.3
PHP Bug Type:     Class/Object related
Bug description:  continued: abstract static functions cause error on invocation

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 bug report at http://bugs.php.net/?id=32507&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32507&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32507&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32507&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32507&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32507&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32507&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32507&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32507&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32507&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32507&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32507&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32507&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32507&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32507&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32507&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32507&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32507&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32507&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32507&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32507&r=mysqlcfg

Reply via email to