Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55536 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53818 invoked from network); 19 Sep 2011 09:56:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Sep 2011 09:56:09 -0000 Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; 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:48127] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/FB-14600-6B1177E4 for ; Mon, 19 Sep 2011 05:56:07 -0400 Received: by bkar4 with SMTP id r4so5125266bka.29 for ; Mon, 19 Sep 2011 02:56:03 -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=0Oqdt6E5d0Clr03vvJI09Fm05l0PkGmIX7d/L24kylY=; b=BBBbbZ3H8jUlIXt63cxrK/aAu/rh1TETU5vnX/UiUCv5C8cWXyzZJO8Em8LA/I1QNH 709EcIznirT5ghBAD5rsIc3aSyabjdW0+KOFzMD+MZk63OYHncRcR7bStfBqQoEq74lk +fy/wL8dX+vb542ARHSxNiwgd9fOtdr3fzXP4= MIME-Version: 1.0 Received: by 10.204.141.80 with SMTP id l16mr691803bku.183.1316426163315; Mon, 19 Sep 2011 02:56:03 -0700 (PDT) Sender: ekneuss@gmail.com Received: by 10.204.59.68 with HTTP; Mon, 19 Sep 2011 02:56:03 -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 11:56:03 +0200 X-Google-Sender-Auth: YH-NQasQeQYSSouh1BhOd8kZW8Q Message-ID: To: Pierre Joye Cc: Stas Malyshev , PHP internals Content-Type: multipart/alternative; boundary=001517448364d664a604ad4859e5 Subject: Re: [PHP-DEV] __constructor parameter limitations. From: colder@php.net (Etienne Kneuss) --001517448364d664a604ad4859e5 Content-Type: text/plain; charset=UTF-8 Hi, On Mon, Sep 19, 2011 at 11:28, Etienne Kneuss wrote: > Hi, > > On Mon, Sep 19, 2011 at 11:19, Pierre Joye wrote: > >> On Mon, Sep 19, 2011 at 11:12 AM, Stas Malyshev >> wrote: >> > Hi! >> > >> > On 9/19/11 2:02 AM, Pierre Joye wrote: >> >> >> >> Sorry but your constantly rejecting any logical, documented, known >> >> principles for the abstract concept is killing me. >> > >> > I didn't see any documented principle that say the code I cited is >> > prohibited. Only example you brought so far is C function declaration >> that >> > has nothing to do with OO. You want to prove you point - prove it, not >> > repeat it. >> >> With the risk to sound harsh, please do your home work and stop to ask >> me (or other) to go fetch quotes from very well kown OO programming >> reference and paste them here. Thanks for your understanding. >> > > There is a precondition that the abstract method enforces in such > prototypes, and it is: > - I will require at least X arguments > > if a method implements this and defines the prototype with: > - I will require at least Y arguments with Y < X > > The procondition of the subclass method is looser. And this is perfectly > fine. > > You may debate whether it is "at least X" or not that the prototype > defines, but that's exactly what it does and how PHP w.r.t. to function > calls work, we have always allowed more arguments in the call than functions > declares. > 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. > > >> >> Cheers, >> -- >> Pierre >> >> @pierrejoye | http://blog.thepimp.net | http://www.libgd.org >> >> -- >> 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 --001517448364d664a604ad4859e5--