Marcus Boerger wrote:
Well you design a class tree/framework and should know what you have done.
If not use reflection.

So to be able to later add a constructor to a base class one would be stuck with one of two options:
1) have __construct() in all classes from the start, even if it's empty. Ugly and stupid. Not even Java forces one to do that :-)
2) Use reflection in all extending classes to check if a constructor exists. Inacceptable, a joke at best.


A change is a change.

OO is about extending classes without having to touch users of the class if the interface remains the same. Arguing that adding a constructor changes the interface is silly, especially if it is a parameterless one.


That would slow down execution ***very*** much and makes absolutely no
sense at all. If you want a base class for your classes do it. Fell free.

I don't buy that: The place where
zend_error(E_ERROR, "Can not call constructor");
is done could easily just ignore the call.
Maybe it could be turned into E_NOTICE or E_STRICT for people who want to be notified about such calls.


I'll post a patch on the WE if noone else is doing it.

- Chris

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



Reply via email to