Andi Gutmans wrote:
There's a big difference. Inherited classes should adhere to the
instanceof operator. Meaning that if you get an object you can check
if it's an instance of another class and if so, you can call it
*exactly* the way you could the parent class. This allows for good
polymorphic design in applications. Allowing subclasses to change a
function's signature to be incompatible with its parent would break this rule (you can use default arguments to resolve some of these
cases as instanceof remains). For constructors it actually makes
sense because at the time of instantiaton, you know what the concrete
class is. It is very common for constructors to be very much
different in polymorphic classes.

This is only partly true.  In languages where you can be sure to call A::f()
this is useful.  You suggest to change PHP, which doesn't have any other means
for decent overloading, in a way that completely removes this freedom.
Using interfaces is IMHO the way to enforce method signature in PHP.

If there are no other evidences I cannot understand this design move.

--
Michael

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

Reply via email to