Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52416 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73351 invoked from network); 16 May 2011 22:10:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2011 22:10:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=andrewcurioso@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=andrewcurioso@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: andrewcurioso@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:56470] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/30-05805-6E0A1DD4 for ; Mon, 16 May 2011 18:10:47 -0400 Received: by vwl1 with SMTP id 1so4261565vwl.29 for ; Mon, 16 May 2011 15:10:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=LBpzRG6m6DWWeSvgYTdsJpCL5+SFQg9f1gBxqjMX56U=; b=PyXmqTbtk8OSau8OLTHMA0pL5LVProWLAg2qkWU6+h1gtPiASnIUn7AlTFMHRgOG48 5dmGsvWeK5REwx9CoEkDSbulFQVTyVco+p85Ui7LdmFXZ1RybH1DTdnumYx+yzOeKg/r Vf/2XLufppxaucDtRtanCENSHje0k6jVst9/U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=DVAI9X1cBtHpJpj8/n5huKBJ5uFAyHpapsbgXA0MY/PYV8eqDT/Yw8jc20rw+IqLx+ 15TnSaBoNvvWKla8IHXiqaQ4zGYZDLgQHZ055iQeR+789tkMABILROarWlITdbW4phCJ 3EI1b9QThe7ImdrEyzYEGfbP2e4mWt6VL6OLk= MIME-Version: 1.0 Received: by 10.52.98.102 with SMTP id eh6mr6686485vdb.298.1305583844012; Mon, 16 May 2011 15:10:44 -0700 (PDT) Sender: andrewcurioso@gmail.com Received: by 10.52.101.167 with HTTP; Mon, 16 May 2011 15:10:43 -0700 (PDT) In-Reply-To: <20110516212511.GA13139@crousti> References: <1305570720.1344.535.camel@guybrush> <4DD17ECD.4070505@sugarcrm.com> <20110516212511.GA13139@crousti> Date: Mon, 16 May 2011 18:10:43 -0400 X-Google-Sender-Auth: bL-lOUsgLSSaNUHVaUdzS_yEhW4 Message-ID: To: Etienne Kneuss Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=20cf307f34a23f33a104a36beda5 Subject: Re: [PHP-DEV] Inconsistencies with constructors in SPL From: andrew@andrewcurioso.com (Andrew Curioso) --20cf307f34a23f33a104a36beda5 Content-Type: text/plain; charset=ISO-8859-1 I had given up on someone actually going with one of my original ideas for fixing the bug! That is where I was leaning but I would take it a step further and add constructors to all SPL classes even if the docs don't currently list one. In regards to the implicit ctor and dtor. I don't thing it is actually any more or less magic than what we have now. Ask a Java programmer, they will likely say that having the implicit ctor and dtor just makes sense and not having one is strange. Although, in Java, all classes descend from Object so it is not quite the same. Side not: of course, an RFC does not mean that it will end up in a release. It would still need to be voted on. On Mon, May 16, 2011 at 5:25 PM, Etienne Kneuss wrote: > > 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, > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > --20cf307f34a23f33a104a36beda5--