Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56522 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68789 invoked from network); 23 Nov 2011 18:37:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2011 18:37:05 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.49 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.216.49 mail-qw0-f49.google.com Received: from [209.85.216.49] ([209.85.216.49:43804] helo=mail-qw0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7B/53-47904-05D3DCE4 for ; Wed, 23 Nov 2011 13:37:05 -0500 Received: by qadc16 with SMTP id c16so1869985qad.8 for ; Wed, 23 Nov 2011 10:37:02 -0800 (PST) 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=gRXAHEwfCRqJ4EwLF7uYt2HXGHVP/nrTHtY4CH2MnZY=; b=q+zvcsu+hC4TXCXDnoUI7dC5lSGkCeO7Rrl6EVs3XmdUW6qvwThI4Pfc7hthO+qpY6 v5GU5q1/w7cV90gTWRnV3vjPi9Nuh4POvuZxLc+QhxHNpK+4nFVplqzIobq0+qnZr7zY 5A6UB/ml3frMrq2rVg8RjxR5sp7Cte01GdNgY= MIME-Version: 1.0 Received: by 10.224.9.72 with SMTP id k8mr11532209qak.24.1322073422456; Wed, 23 Nov 2011 10:37:02 -0800 (PST) Received: by 10.229.228.209 with HTTP; Wed, 23 Nov 2011 10:37:02 -0800 (PST) In-Reply-To: <4ECD3A9E.7090105@ralphschindler.com> References: <4EC578C9.4000408@ralphschindler.com> <4ECD3A9E.7090105@ralphschindler.com> Date: Wed, 23 Nov 2011 13:37:02 -0500 Message-ID: To: Ralph Schindler Cc: Pierre Joye , Derick Rethans , internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Changes to constructor signature checks From: ircmaxell@gmail.com (Anthony Ferrara) Ralph: From where I'm sitting, I can see a few sane alternatives (there may be more, but here are the options I can see): Option 1. Remove signature checking from constructors all together. (I don't care for this, but whatever). Additionally, since it's not enforced, perhaps an E_DEPRECATED or E_STRICT error should be raised on definition, as it is superfluous... Option 2. Fix grandchild signature checking to be inline for how signatures work with other methods. Personally, I think option 2 is the better one. I see it being odd and inconsistent that all methods work one way, and constructors work differently. But that's just my feeling (and I know others disagree there). And please don't reduce the error level of a signature change (as it would introduce even more inconsistency)... Just my $0.02... Anthony On Wed, Nov 23, 2011 at 1:25 PM, Ralph Schindler wrote: > Internals: > > Time to summarize. > > It is clear to me that internals is divided on this issue. =A0I don't thi= nk > it's a large enough issue to drag on, even when I disagree with it - both > theoretically and in practice. > > For most OO developer, putting ctors as an abstract or in an interface wo= uld > not happen anyway, so this does not affect them. > > ** The current change represents a minor break in BC, that should be note= d > in the manual. ** > > Also, a decision needs to be made on what to do with grandchildren. =A0As= I > mentioned, the following produces no E_FATAL and no warnings: > > =A0abstract class A { =A0abstract public function __construct($a, $b); } > =A0class B extends A { public function __construct($a, $b) {} } > =A0class C extends B { public function __construct(ArrayObject $d) {} > > While this is correct behavior to me (ability for concrete to use its own > ctor), using the *current logic* strict signature checking enforced from = an > abstract, then the above is also wrong. > > ** Can we decide what to do with that situation? ** > > On 11/18/11 5:05 AM, Pierre Joye wrote: >> >> I strongly disagree, this encourages bad practices. We could however >> reduce the error level to warning. > > I think this is a sufficient compromise- I don't see anything E_FATAL abo= ut > a signature change in ctors (I actually see nothing wrong with it, but it= 's > clear the community is divided there). > > ** Can we make that change? ** > > > Thanks, > -ralph > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >