Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55538 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57333 invoked from network); 19 Sep 2011 10:05:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Sep 2011 10:05:09 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.42 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.213.42 mail-yw0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:59804] helo=mail-yw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/BC-14600-4D3177E4 for ; Mon, 19 Sep 2011 06:05:09 -0400 Received: by ywa8 with SMTP id 8so4664993ywa.29 for ; Mon, 19 Sep 2011 03:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=MVR3uBTjIBanDn91iJ07zKWznWZgSO9misqNuuL8ZJs=; b=qjLM9k/7txGgW8jjnfRpYWDbo1nllse10nmx6eZ0mGOBdT1DMNZneArKSwf/Cniyck CCUjpQeZlLorcdoIkXHcELwgpFIIb+dpFPFnNxnWTrtGSpAQau1QHIi79G0SkYgZO3eQ LzFu2azAzGz8kNKKWT2NdSj1thLnPDXg5zVIc= MIME-Version: 1.0 Received: by 10.146.181.25 with SMTP id d25mr394330yaf.3.1316426706311; Mon, 19 Sep 2011 03:05:06 -0700 (PDT) Received: by 10.147.125.13 with HTTP; Mon, 19 Sep 2011 03:05:06 -0700 (PDT) In-Reply-To: References: <4E74E5A0.2030006@sugarcrm.com> <4E76320F.6010904@sugarcrm.com> <4E764137.9080507@sugarcrm.com> Date: Mon, 19 Sep 2011 12:05:06 +0200 Message-ID: To: Gustavo Lopes Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] __constructor parameter limitations. From: tyra3l@gmail.com (Ferenc Kovacs) On Mon, Sep 19, 2011 at 11:55 AM, Gustavo Lopes wr= ote: > Em Mon, 19 Sep 2011 10:35:47 +0100, Ferenc Kovacs > escreveu: > >> could you check my second(lengthy) mail on this thread? >> I also tried to come up with the valid, and invalid signature changes. >> I forget to take references into account, so thanks for pointing that ou= t. >> > > I mostly agree with you, with these exceptions: > > * No catchable fatal error -- E_STRICT or E_NOTICE. Ok, from the responses, I changed my mind already about the fatal. > * There's no reason checking typehints contravariance would be particular= ly > difficult. we discussed this with ekneuss on irc, and the big change would be, that currently the typehints only checked in runtime, to enforce the signature, the check should be done when the Subclass definition is parsed by the engine (when it would have to autoload, the typehinted class, etc. and it would require traversing the class hierarchy. which would also create some performance penalty compared to the old behavior) the other thing, what ekneuss also pointed out, that in my example, I mentioned allowing overriding the typehint from Superclass to Subclass, but the opposite (allowing Super where Super was used in the parent) would be more in line with the "allow to override as long as it is more general than the parent" idea. > * Allowing less arguments in subclasses, as I've argued in the thread. I think that I mentioned that, maybe only after that mail, so yes, I'm also support this, see my Square example in this thread. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu