On 19 Apr 2004 at 20:44, Marcus Boerger wrote:

> Simply decalre thos methos with an empty signature and use the
> appropriate functions to handle the arguments?

That does not work for foreign/internal interfaces/base classes.

Again: Why should we add this strictness? Since PHP is loosely 
typed, you can't guarantee that a class is implementing an interface 
correctly even if the method accepts the same number of 
arguments...

I am NOT saying that Interfaces are useless (or would be without 
strict arguments checking).

What about this case:

interface A {
    public function doSomething($integer1, $integer2);
}

interface B {
   public function doSomething(MyObject $obj);
}

class Impl implements A, B
{
    // "Overloaded" - supports both doSomething() interfaces
    public function doSomething()
    {
        // Use var_args to distinquish the two doSomething()'s
    }
}

-- 
Ferdinand Beyer
<[EMAIL PROTECTED]>

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to