Hello Hans, Tuesday, February 17, 2004, 10:43:41 PM, you wrote:
> Hi- > Cristiano Duarte wrote: >> >>>I 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. >> > 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 ? :) That is no option because it breaks is-A relation. It chages it to has-A. And if we would allow that we could easily have protected and private inheritance (is-implemented-with) as well as decreasing member visibility. But hey again this would complicate things very much. Only those with an academic background or the very experienced programmers are capable of understanding those inheritance forms and their rules. -- Best regards, Marcus mailto:[EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php