Re: more on interface inheritance issues
| From: | Hans Lellelid | Date: | Tue, 17 Feb 2004 21:43:41 +0000 |
| Subject: | Re: more on interface inheritance issues | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-7936@lists.php.net to get a copy of this message | ||
Hi-
Cristiano Duarte wrote:
That would also be completely acceptible, but I think it would make many people mad :) At that point PHP would need to consider implementing overloading. Obviously overloading couldn't be as fine-grained as in a typed lang, but the rule "if method has a non-compatible sig then methd is overloaded" would be nice. Maybe PHP 5.1 ? :) HansI still think that interfaces should follow the same behavior as classes (i.e. if you can override in classes you can override in interfaces), but I understand that academically this is wrong. Of course overriding is wrong period, but it's the route you have to take when overloading isn't an option.IMHO, this odd behavior exists because of the lack of overloading support. To be consistent, PHP shouldn't allow the overriding of methods with different signatures or register, at parse time, that the child break the inheritance for each parent that has methods overriden with different signatures.