Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52417 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94143 invoked from network); 17 May 2011 00:22:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 May 2011 00:22:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=benjamin.dubois@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=benjamin.dubois@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: benjamin.dubois@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-wy0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:61560] helo=mail-wy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E1/B3-05805-CCFB1DD4 for ; Mon, 16 May 2011 20:22:37 -0400 Received: by wyb34 with SMTP id 34so4309762wyb.29 for ; Mon, 16 May 2011 17:22:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to:x-mailer; bh=NFQB4YeE74blTuFx0xLWeSw7Z+hyh9lPfklUmdxYnLY=; b=p4GdbkQhztLmeiALOt70WkJWVpSGQ7WfjOjo8kMOmntGBCqC8ZhMEUaLv4QsEyWQSW hv6AOwoNCRt42Z9jrYoHn1W4xnSbNVuSd9YbCHo378yfbfAQ9t80Wwpjn2Lx+cHcaQBw hv5obJoBWvJjIhi67Jy1TdI9htmqS1oP9V3dU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; b=mcrvWAOlngmUd/1pDc2cT7+5OUPe82y/MxmTxiIkwutPsJTYVIPz/47tMSpLujDWyw qYSSM1tQ5fyA7uk3iZVZVbDLzgjL5Fq/wMRTkyfT1Bpal0fE9JZeMc0IcQV9lezvVi4j NWQU86rJ3G2mNwQZA3lCSjkP5YK3x828S8Ykk= Received: by 10.216.69.74 with SMTP id m52mr22217wed.33.1305591753845; Mon, 16 May 2011 17:22:33 -0700 (PDT) Received: from [10.0.1.20] (85-170-208-8.rev.numericable.fr [85.170.208.8]) by mx.google.com with ESMTPS id p36sm1603872weq.33.2011.05.16.17.22.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 May 2011 17:22:32 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1227) Content-Type: multipart/alternative; boundary="Apple-Mail=_F803FFF6-8A08-49BC-A136-A1800D600F89" In-Reply-To: <20110516212511.GA13139@crousti> Date: Tue, 17 May 2011 02:22:30 +0200 Cc: internals@lists.php.net Message-ID: <7FCA24D2-64A9-4E8C-8AE9-8934A5B074E6@gmail.com> References: <1305570720.1344.535.camel@guybrush> <4DD17ECD.4070505@sugarcrm.com> <20110516212511.GA13139@crousti> To: Etienne Kneuss X-Mailer: Apple Mail (2.1227) Subject: Re: [PHP-DEV] Inconsistencies with constructors in SPL From: benjamin.dubois@gmail.com (Benjamin Dubois) --Apple-Mail=_F803FFF6-8A08-49BC-A136-A1800D600F89 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Hi, Why not make all objects (maybe implicitly) extend a single root object, = containing just skeleton ctor/dtor and implemented in the engine ? I don't know if it is actually possible in PHP, but that works for = several other languages (java, objC - in that case, the root object is = explicit-, C# AFAR) This would also bypass the error-level debate (no error would be thrown) -- Regards, Benjamin Dubois Le 16 mai 2011 =E0 23:25, Etienne Kneuss a =E9crit : > Hi, >=20 > 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? >>=20 >> I'm assuming just the implicit ctor and dtor. Not all magic methods = (not >> now, at least). >>=20 >> With your OK, Stas, I'd like to write up an RFC and put it on the = Wiki. >>=20 >> - Andrew >=20 > 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. >=20 > 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. >=20 > As far as implicitly ignore of the constructor, I believe we have = enough > magic regarding ctors/dtors in the engine as it is. >=20 > Best, >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20 --Apple-Mail=_F803FFF6-8A08-49BC-A136-A1800D600F89--