Hello Christian, I can very much understand the drive behind this whish. The patch consists of two parts. The first part is generating an error message in case no constructor is available. He uses E_NOTICE while i would prefer E_STRICT there. Then the second part is a bit strange. It looks like if we could ignore other functions/methods with the patch.that doesn't look right. From my perspective skipping a function should only work for __construct and __destruct and only in construction (new) and destruction (unset) of the object.
From my short look it seems the whole thing should be done in another way. The prblem i see is that it is hard to check whether we are in constructor or destructor and are about calling inherited once. We cannot ignore any other method or function calls. To enforce that the change only affects construtor and destructor chains we'd have to add EG states for constructor and destructor calling and push/pop them when dealing with eval etc. This adds a lot of complexity which i would like to prevent. marcus Sunday, January 25, 2004, 11:29:49 PM, you wrote: > Stephane Drouard wrote: >> Implementing a common base class with empty methods (or Chris' proposal, just do not >> report error) does not impact performance (just don't call them), but allows people >> having a different view on programming to do it. > Here's a little patch which changes "Can not call constructor" from > E_ERROR to E_NOTICE and continues execution: > http://cschneid.com/php/php5/undefined_constructor_call.patch > Feel free to point out problems with this patch and I'll spend more time > on it. > I think it is a very bad idea to release PHP 5 like this. Look at the > mess caused by the pre-PHP 4 feature freeze back then, especially the > copy-on-assign decision which was a lot more painful to fix in PHP 5 > than if it would have been done right in PHP 4. We should _not_ repeat > this mistake. There's already enough problems with PHP 5 (e.g. no clean > transition for __clone() from PHP 4 to PHP 5 due to the PHP 4.3 feature > freeze), let's clean up as much as possible. > It will make life for millions of PHP users so much easier if they can > rely on some basic facts like parent::__constructor() and not having to > write their own base class just to add an empty constructor. > I believe a language should make life for programmers easy, not hard. > PHP is almost there. > - Chris -- Best regards, Marcus mailto:[EMAIL PROTECTED]