Re: [ZEND-ENGINE-CVS] interfaces
| From: | Marcus Boerger | Date: | Tue, 06 Jun 2006 19:27:16 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] interfaces | ||
| References: | 1 2 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-4984@lists.php.net to get a copy of this message | ||
Hello Andi,
that is not what Tony fixed (at least intended to), in the code below
the interface is only inherited once. The problem is that we must not have
the same interface listed multiple times. Especially on the same hirarchy
level one should not be able to add the same interface more then once.
The following code must however be valid:
abstract class T implements Iterator {}
abstract class RT extends T implements RecursiveIterator {}
ReflectionClass::Export("RT");
This correctly shows: abstract class RT extends T implements RecursiveIterator, Traversable,
Iterator
The next code is also valid but the output is wrong since it lists
interface Iterator twice:
abstract class T implements Iterator {}
abstract class RT extends T implements Iterator {}
ReflectionClass::Export("RT");
The keypoint here is that we neither support MI for classes nor virtual
inheritance for interfaces.
So Tony was nearly correct :-)
best regards
marcus
Tuesday, June 6, 2006, 5:54:41 PM, you wrote:
> That's what I thought. Thanks Stas for checking it out.
> Antony, it's ok if you warn if there are two on the same line e.g.
> implements foo, foo but if the interface is inherited we shouldn't
> prevent that.
> Andi
> At 08:43 AM 6/6/2006, Stanislav Malyshev wrote:
>>About interfaces and doble interfacing prohibition patch - Java allows this:
>>
>>class A implements Serializable {
>>}
>>
>>class B extends A implements Serializable {
>>}
>>
>>
>>--
>>Stanislav Malyshev, Zend Products Engineer
>>stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115
>>
>>--
>>Zend Engine CVS Mailing List (http://cvs.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
Best regards,
Marcus