Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55549 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78148 invoked from network); 19 Sep 2011 11:25:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Sep 2011 11:25:28 -0000 Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.45 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.212.45 mail-vw0-f45.google.com Received: from [209.85.212.45] ([209.85.212.45:33925] helo=mail-vw0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4F/F0-14600-6A6277E4 for ; Mon, 19 Sep 2011 07:25:27 -0400 Received: by vws17 with SMTP id 17so10501551vws.32 for ; Mon, 19 Sep 2011 04:25:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=E8JH5bC94VKUH+XiibwH311mGte3u2Q4cN8X3lEV9VI=; b=Ba+mU0cYNQEr3tuF8BHHnEByy8tq+Hf/gbJ0LFExMvvcdf8IHlvDcOM9F+14KOVjvb nZGlFhd2Ehq5Inj9IK30PtrWGAsT3rORq2yPtvJoGHvpvJrmU/RuZPGKKyhPmfZKKNRp JulJnFoLLJeo/OxTxgORhYVZwYVk6zHZH2Ggk= Received: by 10.52.95.105 with SMTP id dj9mr1860005vdb.167.1316431523230; Mon, 19 Sep 2011 04:25:23 -0700 (PDT) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.220.94.142 with HTTP; Mon, 19 Sep 2011 04:25:02 -0700 (PDT) In-Reply-To: References: <4E74E5A0.2030006@sugarcrm.com> <4E76320F.6010904@sugarcrm.com> <4E764137.9080507@sugarcrm.com> <4E7685DE.6010805@sugarcrm.com> <4E768C86.3030307@sugarcrm.com> <4E769418.6040200@sugarcrm.com> <4E770163.2090001@sugarcrm.com> <4E770770.60809@sugarcrm.com> Date: Mon, 19 Sep 2011 19:25:02 +0800 X-Google-Sender-Auth: HF2pwk-GkZWQI9934JCCogihYvo Message-ID: To: Etienne Kneuss Cc: Gustavo Lopes , internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] __constructor parameter limitations. From: laruence@php.net (Laruence) 2011/9/19 Etienne Kneuss : > Hi, > > On Mon, Sep 19, 2011 at 12:40, Etienne Kneuss wrote: > >> Hi, >> >> On Mon, Sep 19, 2011 at 12:18, Gustavo Lopes wro= te: >> >>> Em Mon, 19 Sep 2011 10:56:03 +0100, Etienne Kneuss >>> escreveu: >>> >>> >>> >>>> Apparently you guys are speaking about the initial implementation of a= n >>>> abstract method, while I was talking about overriding a method, which = is >>>> not the relly same. So the above doesn't really apply. >>>> >>>> The initial implementation of an abstract method should match the >>>> signature, >>>> while overriding a method should be able to loosen the precondition in >>>> many ways (type hints change, less arguments, etc..), IMO. >>>> >>>> >>> I should like to hear why. As far as I can see, there's absolutely no >>> difference. All I've seen in this thread to this respect are semantic >>> pseudo-arguments. >>> >> >> Well it is about semantics, and IMO defining a method as abstract is som= e >> sort of declaration, and this declaration should be respected when the >> method is actually implemented. >> >> On the other hand, interfaces define usage capabilities, and those usage= s >> should work. >> >> There might be close to no difference in the way the are internall handl= ed >> currently, but IMO there is a semantic difference between the two. >> > > Given that the discussion has now gone into many directions: > - constructors/normal methods > - abstract/interfaces/overriding > > Let me write some small RFC describing what we currently do w.r.t. protot= ype > checks, and also summarize what people propose as changes to them. We can > then discuss those and eventually vote for the way to go forward. That will be nice, thanks. > > >> >> >>> I'd say interfaces are much more likely to include more useless paramet= ers >>> than a concrete method definition, which most likely will only include = the >>> arguments it actually needs. >>> >>> An example: >>> >>> http://www.google.com/**codesearch#HmA4mAI_aLc/src/** >>> main/java/terrastore/server/**impl/support/**JsonBucketsProvider.java&q= =3D* >>> *implements%5C%**20MessageBodyWriter&type=3Dcs&l=3D**36 >>> >>> This is the most common scenario for implementations of this interface >>> (see the other search results). >> >> >>> -- >>> Gustavo Lopes >>> >>> -- >>> PHP Internals - PHP Runtime Development Mailing List >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >> >> >> -- >> Etienne Kneuss >> http://www.colder.ch >> > > > > -- > Etienne Kneuss > http://www.colder.ch > --=20 Laruence =C2=A0Xinchen Hui http://www.laruence.com/