Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52414 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65790 invoked from network); 16 May 2011 21:25:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2011 21:25:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=colder@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=colder@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 94.103.100.39 as permitted sender) X-PHP-List-Original-Sender: colder@php.net X-Host-Fingerprint: 94.103.100.39 mailer.immomigsa.ch Linux 2.6 Received: from [94.103.100.39] ([94.103.100.39:55457] helo=mailer.immomigsa.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/D5-26716-93691DD4 for ; Mon, 16 May 2011 17:25:14 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mailer.immomigsa.ch (Postfix) with ESMTP id 39BCB4B625FD for ; Mon, 16 May 2011 23:25:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at immomigsa.ch Received: from mailer.immomigsa.ch ([127.0.0.1]) by localhost (mailer.immomigsa.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Rzrh2FkyV6lY for ; Mon, 16 May 2011 23:25:09 +0200 (CEST) Received: from crousti (46-126-188-75.dynamic.hispeed.ch [46.126.188.75]) by mailer.immomigsa.ch (Postfix) with ESMTPSA id F27B84B625E7 for ; Mon, 16 May 2011 23:25:07 +0200 (CEST) Received: by crousti (sSMTP sendmail emulation); Mon, 16 May 2011 23:25:11 +0200 Date: Mon, 16 May 2011 23:25:11 +0200 To: internals@lists.php.net Message-ID: <20110516212511.GA13139@crousti> References: <1305570720.1344.535.camel@guybrush> <4DD17ECD.4070505@sugarcrm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [PHP-DEV] Inconsistencies with constructors in SPL From: colder@php.net (Etienne Kneuss) Hi, On May 16 16:52:08, Andrew Curioso wrote: > Well, that wasn't where I was expecting that thread to go, but to wrap it up > what do you think... > Is it too late to put this on the 5.4 roadmap for consideration? > > I'm assuming just the implicit ctor and dtor. Not all magic methods (not > now, at least). > > With your OK, Stas, I'd like to write up an RFC and put it on the Wiki. > > - Andrew The main problem with internal classes and ctors is that constructor code can be placed at object init instead of in the actual ctor method. It is actually safer to place it at object init, because then that code is always executed and thus the internal object is not in a half initialized state if the user overwrites the constructor and doesn't call the parent. I'd rather have ctors/dtors explicitely defined in SPL. If they are documented to exist, they should be explicitely defined. We can define such NOOP methods globally, so that it is easy for internal classes to add them. As far as implicitly ignore of the constructor, I believe we have enough magic regarding ctors/dtors in the engine as it is. Best,