Hi, On Mon, Sep 19, 2011 at 11:28, Etienne Kneuss <col...@php.net> wrote:
> Hi, > > On Mon, Sep 19, 2011 at 11:19, Pierre Joye <pierre....@gmail.com> wrote: > >> On Mon, Sep 19, 2011 at 11:12 AM, Stas Malyshev <smalys...@sugarcrm.com> >> 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