From:             
Operating system: Debian
PHP version:      5.3.3
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:Impossible to implement Interfaces with same method names

Description:
------------
It's impossible to implement interfaces with same method names. Whath's the
most strange is, that you can simply "hack" this by implementing each
interface at different inheritance level.



(it's in fact PHP 5.3.2 issue, but I didn't see it fixed in PHP 5.3.3)

Test script:
---------------
first case:

--

interface Foo

{

    public function getID();

}



interface Bar

{

    public function getID();

}



class A implements Foo, Bar

{

    public function getID()

    {

        return 1;

    }

}



second case:

--

interface Foo

{

    public function getID();

}



interface Bar

{

    public function getID();

}



class A implements Foo

{

    public function getID()

    {

        return 1;

    }

}



class B implements Bar

{

}



third case:

--

interface Foo

{

    public function getID();

}



interface Bar

{

    public function getID();

}



class A implements Foo

{

    public function getID()

    {

        return 1;

    }

}



class B implements Bar

{

    public function getID()

    {

        return parent::getID();

    }

}

Expected result:
----------------
Nothing at output, but all of them compile.

Actual result:
--------------
first case: Fatal error: Can't inherit abstract function Bar::getID()
(previously declared abstract in Foo) in Command line code on line 1

second case: Fatal error: Can't inherit abstract function Bar::getID()
(previously declared abstract in Foo) in Command line code on line 1

third case: worked fine

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

Reply via email to