Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79127 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66792 invoked from network); 24 Nov 2014 15:25:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Nov 2014 15:25:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.49 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.49 mail-wg0-f49.google.com Received: from [74.125.82.49] ([74.125.82.49:44605] helo=mail-wg0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/55-33396-3DD43745 for ; Mon, 24 Nov 2014 10:25:07 -0500 Received: by mail-wg0-f49.google.com with SMTP id x12so12450391wgg.22 for ; Mon, 24 Nov 2014 07:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=p+suNaHzm+wK2zvtQ4I2E1YzcTOeqbphMzCF1U3qmPo=; b=P7TWej4mdFrMQJlaHsiKWX2abdzncDcyeZkqDnfvyXcZJR+zaqjdl+VQrP86BuiD8C qoWeJsTYoHFx8bfCv5memiI0/+dx2EdorCsRiSTyt2Pw7gU96IwRwm9O9olrKozV0xHo pLv58qBr72OUuEZordLsdi3Cfp4aKyn/BQVc7JJhePq6N+kDC/LoX9YGuFxsVE35AvQI gUFrNRUdFfDdDhe+malYuh4PHEX++0Uejp3OjHzTMhp27fMwPFKd/RchVtI3YmYuPSLX Bj3xDCiBUigNKy63hlT/QEycFgcrRsAyB6X7K4U/Oj4vn5qA6U5cx0dtSr34i+YVvWo7 M+Ew== X-Received: by 10.180.92.169 with SMTP id cn9mr22817489wib.26.1416842704183; Mon, 24 Nov 2014 07:25:04 -0800 (PST) Received: from [192.168.0.148] ([62.189.198.114]) by mx.google.com with ESMTPSA id p1sm21461251wjy.22.2014.11.24.07.25.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Nov 2014 07:25:03 -0800 (PST) Message-ID: <54734DAC.7080706@gmail.com> Date: Mon, 24 Nov 2014 15:24:28 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: internals@lists.php.net References: <546B0F62.1090705@gmail.com> <546E3656.2010608@gmail.com> <546EB8B3.3020807@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Default constructors From: rowan.collins@gmail.com (Rowan Collins) Dmitry Stogov wrote on 24/11/2014 09:56: > However, I thought about one more inconsistent. Your patch works fine for > "parent::" methods but not for "grandparents::" > In the following code "default constructor" won't work. > > class A { > } > class B extends A { > } > class C extends B { > function __constructor() { > A::_constructor(); // this won't work > } > } I guess some inconsistency like this is hard to avoid unless the default constructor is actually added to the class's method table, because the code has to specifically check for each case that is to be supported. At risk of flogging a dead horse, this is why I was arguing for the lazy evaluation with new keyword to be abandoned, because it seems like that's the primary compatibility issue with adding a "real" default definition. Reflection would show the method as either "internal" or inherited from some implicit base class. From a user's point of view there should really be no difference between "no constructor" and "constructor which does nothing", IMHO. Regards, -- Rowan Collins [IMSoP]