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 ? :)
Hans
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php