Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55502 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33042 invoked from network); 18 Sep 2011 18:23:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Sep 2011 18:23:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.215.170 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@googlemail.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:36120] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/90-28880-E27367E4 for ; Sun, 18 Sep 2011 14:23:43 -0400 Received: by eyh6 with SMTP id 6so1239325eyh.29 for ; Sun, 18 Sep 2011 11:23:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=ebp5RA2BW+I7ETzOlXycxwMr9mwzatQiNe6DYoUupNU=; b=arfPJciWN3QsXJyWszMaemm2uo6/irEnwKQl7N0BvhCaZ1fkjl3/180n4Y5StruGo1 lonpiQ4Va5jEOM+Off23FYFWfylSSKQvP9lrVo3xhnYg4CHuKytCHDe8nrbL2NlZT/ww PM9Do5z074ys6I/8ELCHN/LAOMpii70LAUs8s= MIME-Version: 1.0 Received: by 10.14.35.163 with SMTP id u35mr477964eea.64.1316370219311; Sun, 18 Sep 2011 11:23:39 -0700 (PDT) Received: by 10.14.99.205 with HTTP; Sun, 18 Sep 2011 11:23:39 -0700 (PDT) In-Reply-To: <4E76320F.6010904@sugarcrm.com> References: <4E74E5A0.2030006@sugarcrm.com> <4E76320F.6010904@sugarcrm.com> Date: Sun, 18 Sep 2011 20:23:39 +0200 Message-ID: To: Stas Malyshev Cc: Derick Rethans , "RQuadling@GMail.com" , PHP internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] __constructor parameter limitations. From: nikita.ppv@googlemail.com (Nikita Popov) On Sun, Sep 18, 2011 at 8:01 PM, Stas Malyshev wro= te: > 3. Some of them aren't actually a warnings but fatal errors. Example: > > abstract class BaseClass { > =A0 =A0abstract public function foo(Type1 $foo, Type2 $bar); > } > > class ExtendedClass extends BaseClass { > =A0 public function foo() { > =A0 } > } Just to make sure that we all got the situation right: The above code throws the very same error on 5.3, on 5.2 and probably every other PHP 5 version before that (http://codepad.viper-7.com/Mb9Syu, http://codepad.viper-7.com/lwmlaQ). 5.4 only made the behavior consistent for constructors. I didn't see any complaints about this "feature", so I don't really see a reason why we should break BC with 5.3 here and drop the error message. > This doesn't make sense on two levels: there's no reason why I can't exte= nd > foo() this way and there's no reason why abstracts are treated differentl= y > from non-abstracts. 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 to tell you: I need this and that method accepting these and these arguments to work correctly. If the signature isn't enforced, this doesn't make sense anymore. You could just as well drop the signature from abstract method definitions, as it's pointless then. Nikita