From:             rico dot moorman at gmail dot com
Operating system: Linux
PHP version:      5.2.8
PHP Bug Type:     Feature/Change Request
Bug description:  extending interfaces (and abstract classes) inflexible

Description:
------------
With interfaces we are given the possibility to extend them too. We may
define additional methods. But while it's possible to add new methods it's
not possible to change the method signatures.

Within the "normal" class hierarchy on the other hand it's possible
though.

Adding this to the Interface implementation would surely lead to more
overall flexibility of the Interfaces/abstracts.

Reproduce code:
---------------
// interfaces to test with
interface MillableInterface { }
interface StoneInterface extends MillableInterface { }
interface WheatInterface extends MillableInterface { }

// works actually
class Mill {
    function mill(MillableInterface $stuff) {}
}
class StoneMill extends Mill {
    function mill(StoneInterface $stuff) {}
}
class WheatMill extends Mill {
    function mill(WheatInterface $stuff) {}
}

// doesn't work
interface MillInterface {
    function mill(MillableInterface $stuff);
}
interface StoneMillInterface extends MillInterface {
    function mill(StoneInterface $stuff);
}
interface WheatMillInterface extends MillInterface {
    function mill(WheatInterface $stuff);
}

Expected result:
----------------
no fatals ... just a working interface check

Actual result:
--------------
Fatal error: Can't inherit abstract function MillInterface::mill()
(previously declared abstract in StoneMillInterface) in
/home/rico/dingen.php on line 29

-- 
Edit bug report at http://bugs.php.net/?id=47106&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47106&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47106&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47106&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47106&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47106&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47106&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47106&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47106&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47106&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47106&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47106&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47106&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47106&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47106&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47106&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47106&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47106&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47106&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47106&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47106&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47106&r=mysqlcfg

Reply via email to