ID:               33698
 Comment by:       lukasz dot wojciechowski at ngsoft dot pl
 Reported By:      jason at hybd dot net
 Status:           Suspended
 Bug Type:         Feature/Change Request
 Operating System: *
 PHP Version:      5.0.4
 New Comment:

I just run into this problem and I decided to post a comment to bring
attention to this issue.

--
Best regards
£ukasz Wojciechowski


Previous Comments:
------------------------------------------------------------------------

[2007-02-01 09:48:19] mail at rones dot de

Is there someone thinking (or even working) on this issue? It is really
important if you want to use different 3rd party components which
provides interfaces you have to implement to use the components and
there exists some methods _with the same signature_ more than once. In
case of different signatures I can understand there would occur problems
because PHP does not have an method overloading possibility yet.

------------------------------------------------------------------------

[2005-07-15 14:13:13] [email protected]

FWIW, I agree; I think our interface support is pretty crappy because
of this.

I'm changing this to suspended status, because maybe one day it will
appear, it's just not possible at the moment.


------------------------------------------------------------------------

[2005-07-15 13:57:10] jason at hybd dot net

I know PHP != Java, but surely this sort of stuff should be documented?
Most people will expect interfaces to work like Java interfaces or C++
"interfaces" (Pure virtual abstract methods), as many other languages
seem to follow this behaviour. As I said this is debatable as it depends
how you look at things, and likewise it is fairly easy to work round
this issue.

------------------------------------------------------------------------

[2005-07-15 12:44:04] [email protected]

PHP != Java

------------------------------------------------------------------------

[2005-07-14 17:35:15] jason at hybd dot net

Description:
------------
This is debateable if this is a bug or not. Personally, I don't regard
it as a bug.

Classes that implement >1 interface that share common methods raise
fatal errors. Because of the abstract nature of interfaces, no error or
warning should be rasied.

I know PHP <> Java, but Java doesn't raise any errors, and PHP5's OO
model is very close to Java's

Reproduce code:
---------------
    interface FirstInterface
    {
        function execute();
    }
    
    interface SecondInterface
    {
        function execute();
    }
    
    class MyClass implements FirstInterface, SecondInterface
    {
        function execute()
        {
            echo "Hello World";
        }
    }
    
    $obj = new MyClass();
    $obj->execute();

Expected result:
----------------
Hello World

Actual result:
--------------
Can't inherit abstract function SecondInterface::execute()


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33698&edit=1

Reply via email to