Zeev Suraski wrote:

At 13:28 19/04/2004, Christian Schneider wrote:

Zeev Suraski wrote:

1. First of all, I agree that in a perfect world we should go with E_COMPILE_ERROR for everything. Maybe now that's constructors are out


I'm not sure I understand what you mean by everything.


Everything means for both overriding a method and implementing an interface/abstract method.


In my opinion it doesn't, because it breaks the interface of the parent class. I.e., you can no longer use code you've written to work with an object of the parent class, with an object of the child class, which breaks one of the most fundamental principals of OO. In turn, it renders class type hints useless, because the fact that you have an object of type Foo gives you very little - you have no idea what its interface is, because Bar, derived from Foo, can have a completely different interface.

I think using a compile error for interface/abstract class issues is a *very* good thing, but turning inheritance into an interface is not. If someone wants to know that a particular class instance has a predefined interface, use an interface.


Shane

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to