From:             spam at krol dot me
Operating system: 
PHP version:      Irrelevant
Package:          Class/Object related
Bug Type:         Bug
Bug description:interface, abstract static function

Description:
------------
abstract static function in class isn't allowed,
but you can define static function in interface

This leads to funny inconsistency where you can create abstract static
function using interfaces



Test script:
---------------
//abstract class A { abstract static function a(); } //invalid

interface I { static function i(); } //valid
abstract class B implements I {} //valid
//class C extends B{} // invalid
//Fatal error: Class C contains 1 abstract method and must therefore be
declared abstract or implement the remaining methods (I::i) in php shell
code on line 1

class D extends B{
static function i(){echo "I have to be implemented"; }
}


-- 
Edit bug report at https://bugs.php.net/bug.php?id=65809&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=65809&r=trysnapshot54
Try a snapshot (PHP 5.5):   
https://bugs.php.net/fix.php?id=65809&r=trysnapshot55
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=65809&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=65809&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=65809&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=65809&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=65809&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=65809&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=65809&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=65809&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=65809&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=65809&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=65809&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65809&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=65809&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=65809&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=65809&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65809&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=65809&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=65809&r=mysqlcfg

Reply via email to