Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55548 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75373 invoked from network); 19 Sep 2011 10:58:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Sep 2011 10:58:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.42 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:54922] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AD/80-14600-B50277E4 for ; Mon, 19 Sep 2011 06:58:36 -0400 Received: by bkar4 with SMTP id r4so5162282bka.29 for ; Mon, 19 Sep 2011 03:58:32 -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:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=YoU6sz3TKf0KZGbn4kLYWh6s4oMC/G/RAqBpJqxr78Y=; b=ql21KL0EJuGIvCBNHAF3auBLDiZ0O3NEk6ZjRNAKduSBjVW+CS5frpKP8CWGtj4HER aAdxYaeXWrxcg7DE+lz2JCrP1B2MQR5wfPD9Z/+bwhuJAIh9KlWjUOF8Fz1iVuDCBo04 UZ1KCPYPYdMTn0KINcHRAYpUFjPhivnQVAqfQ= MIME-Version: 1.0 Received: by 10.204.133.156 with SMTP id f28mr1427864bkt.79.1316429912520; Mon, 19 Sep 2011 03:58:32 -0700 (PDT) Sender: ekneuss@gmail.com Received: by 10.204.59.68 with HTTP; Mon, 19 Sep 2011 03:58:32 -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 12:58:32 +0200 X-Google-Sender-Auth: 2PPVGGzxEnGjDMW2M8V1RYX-3cE Message-ID: To: Gustavo Lopes Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=0015174485ea4eb71004ad49397b Subject: Re: [PHP-DEV] __constructor parameter limitations. From: colder@php.net (Etienne Kneuss) --0015174485ea4eb71004ad49397b Content-Type: text/plain; charset=UTF-8 Hi, On Mon, Sep 19, 2011 at 12:40, Etienne Kneuss wrote: > Hi, > > On Mon, Sep 19, 2011 at 12:18, Gustavo Lopes wrote: > >> Em Mon, 19 Sep 2011 10:56:03 +0100, Etienne Kneuss >> escreveu: >> >> >> >>> Apparently you guys are speaking about the initial implementation of an >>> 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 some > 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 usages > should work. > > There might be close to no difference in the way the are internall handled > 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. prototype 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. > > >> I'd say interfaces are much more likely to include more useless parameters >> 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=* >> *implements%5C%**20MessageBodyWriter&type=cs&l=**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 --0015174485ea4eb71004ad49397b--