Andi Gutmans wrote:
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.
What about factory methods? It makes sense there too.
I could also imagine a base framework which provides very generic
independent classes which are never directly used. An application only
using specialized instances could well profit from simplifying some of
the parameter lists. Less obvious and sneered at by many people I'm sure
but...
... with my main point being that I'd rather have PHP stay too loose
than getting to strict about what's right and what's wrong.
And as someone already pointed out PHP 5 already provides a tool enforce
an interface: Interfaces and abstract classes.
- Chris
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php