Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55504 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61774 invoked from network); 18 Sep 2011 23:21:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Sep 2011 23:21:28 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:43649] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/04-28880-7FC767E4 for ; Sun, 18 Sep 2011 19:21:27 -0400 Received: by yxi13 with SMTP id 13so4454618yxi.29 for ; Sun, 18 Sep 2011 16:21:24 -0700 (PDT) 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; bh=XSfaPaXXD3/9v43C6laH8BaDN18peyYcK3rcjdkGPJA=; b=IEmvBKgBFQbs5I3DhI4rHCrhbsRfspI2ibvcMxl+UiKF+O4wSpAvB3IZ+W5Yak3QEu iFrPdEVB0BxMuxVHtsStKaWAkz18sONxDn5url/3ysYaIR7o1exmm7Iu5ODiPup2uhAB gT3Y2MerUeWNmJ98KITXTlZ1VYRSbBZtUfYN0= MIME-Version: 1.0 Received: by 10.147.53.37 with SMTP id f37mr1574925yak.25.1316388084757; Sun, 18 Sep 2011 16:21:24 -0700 (PDT) Received: by 10.147.41.10 with HTTP; Sun, 18 Sep 2011 16:21:24 -0700 (PDT) In-Reply-To: <4E764137.9080507@sugarcrm.com> References: <4E74E5A0.2030006@sugarcrm.com> <4E76320F.6010904@sugarcrm.com> <4E764137.9080507@sugarcrm.com> Date: Mon, 19 Sep 2011 01:21:24 +0200 Message-ID: To: Stas Malyshev Cc: Nikita Popov , Derick Rethans , "RQuadling@GMail.com" , PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] __constructor parameter limitations. From: pierre.php@gmail.com (Pierre Joye) hi, On Sun, Sep 18, 2011 at 9:06 PM, Stas Malyshev wrote: > There's no matter of "breaking BC" - there's no BC issues with dropping > error messages, nobody's code relies on generating fatal errors for specific > code. Btw, afair there is and was no BC as it was introduced with the abstract support. >> I already tried to explain why it makes sense: An abstract method is >> much like an interface. Both define signatures without implementation. >> If their signatures weren't enforces, what would abstract methods be >> good for? An abstract method (for me) is a way for an abstract class > > What's the point of "enforcing" such signatures? The key word missing here is "compatible". We enforce (or should) compatible signatures. And that makes totally sense. > The only point I know is > that you could call these methods with specific parameters and have it work. > In the example it is possible. Enforcing for the sake of enforcing is > meaningless purism, Are you saying that extending a class and making the constructor incompatible with the extended class is a good thing to allow and to do? If yes then I'd to strongly disagree with this idea as it allows very bad practices (and we have enough opportunities already to shoot ourselves in the head). > No it is not. The signature tells "this method would accept certain > arguments". If you call it with these arguments, it would work. However, > there's no promise to never extend the cases where it works - it goes > contrary to the whole point of OOP to say "I will never loosen preconditions > on my methods". And finally, the reason why abstract differs from the other areas is that they are newer. It was decided not to break BC for the other cases where we should have done the same. While Marcus wanted to do it everywhere, with the same good reasons. Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org