Re: [ZEND-ENGINE-CVS] interfaces

From: Date: Wed, 07 Jun 2006 03:27:42 +0000
Subject: Re: [ZEND-ENGINE-CVS] interfaces
References: 1 2 3  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4986@lists.php.net to get a copy of this message
Hi Marcus, Looks like a good change to me. I think we can live with it not catching that edge case (for which the developer should be shot anyway :) especially as it does only keep the iface once so no biggy. A couple of things re: the patch: a) I see zend_do_implement_interface() is exported. Is the behavior of this function changing in a BC incompatible way? I'm asking mainly because of the new emalloc/erealloc in there which used to be outside. Not sure if it actually affects BC though. b) I prefer changing p_if_num and o_if_num to be more similar to our naming conventions. p_if_num -> parent_iface_num, and o_if_num to current_iface_num (OK not sure about current. Maybe you have a better one :) Looks great! Thanks. Andi At 03:31 PM 6/6/2006, Marcus Boerger wrote:
Hello Andi, hello again on the same matters. I did another patch (against 5.2) which is a bit better. It drops multiple interfaces from the interface list so that reflection nolonger generates wrong output and maybe even prevents from other problems. Now what the patch does: 1) (invalid) interface U {} class X implements U, U {} => error, before U was inherited twice 2) (actually used in SPL) interface U {} class X implements U {} class Y extends X implements U {} => U is inherited only once, no error, before U was inherited twice 3) (in theory wrong) interface U {} class X implements U {} class Y extends X implements U, U {} => U is inherited only once, no error, this is where the patch
     fails, well it is not pedantic, Aontony and myself checked
     it and it seems impossible to catch these without API change.
4) (actually used in SPL) interface U {} interface V extends U {} interface W extends U {} class X implements V, W {} class Y implements U, V, W {} => both classes implement U only once, no error
     before U was inherited multiple times
So besides that the patch is not pedantic but it fixes all issues. What do you guys think? 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 -- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.zend-engine.cvs (#4986) next »