Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7284 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39723 invoked by uid 1010); 22 Jan 2004 22:36:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 39669 invoked from network); 22 Jan 2004 22:36:51 -0000 Received: from unknown (HELO matrix.gna.ch) (195.226.6.8) by pb1.pair.com with SMTP; 22 Jan 2004 22:36:51 -0000 Received: from localhost (localhost [127.0.0.1]) by matrix.gna.ch (Postfix) with ESMTP id 5DA87378; Thu, 22 Jan 2004 23:36:51 +0100 (CET) Received: by matrix.gna.ch (Postfix, from userid 65534) id 13090384; Thu, 22 Jan 2004 23:36:50 +0100 (CET) Received: from cschneid.com (unknown [195.226.4.61]) by matrix.gna.ch (Postfix) with ESMTP id 1FE49378; Thu, 22 Jan 2004 23:36:47 +0100 (CET) Message-ID: <4010507E.7010506@cschneid.com> Date: Thu, 22 Jan 2004 23:36:46 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031009 X-Accept-Language: de-ch, de, en-us, en MIME-Version: 1.0 To: Marcus Boerger Cc: Stephane Drouard , internals@lists.php.net References: <20040122144819.42410.qmail@pb1.pair.com> <125-1581635562.20040122203437@marcus-boerger.de> In-Reply-To: <125-1581635562.20040122203437@marcus-boerger.de> X-Enigmail-Version: 0.76.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on matrix.gna.ch X-Spam-Level: X-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.61 X-Virus-Scanned: by AMaViS Ultramail snapshot-20020531 Subject: Re: [PHP-DEV] base class From: cschneid@cschneid.com (Christian Schneider) 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