Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55515 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19658 invoked from network); 19 Sep 2011 08:33:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Sep 2011 08:33:29 -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.218.42 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.218.42 mail-yi0-f42.google.com Received: from [209.85.218.42] ([209.85.218.42:52578] helo=mail-yi0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/84-14600-75EF67E4 for ; Mon, 19 Sep 2011 04:33:29 -0400 Received: by yib12 with SMTP id 12so4406691yib.29 for ; Mon, 19 Sep 2011 01:33:25 -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=QGGgKqI5WZktXOKy/Hjqv7ca6EA6b/XxuCMtE5MEz08=; b=F3+z/U90eUAjNSoGCIr2zq8EMGirQK8yoUNpb4GV4pIZM5LsFhNHaRUJcbWvI1NpVw +XSjLc9mH+VUjlrBN9Y7/c8pGTQwhTJDw9dpvR3l4XZnJR5lD/LWsS5aIA2rW6NeD7ey jASE5pxs/ljpIUXM/q8uJBeYIBhZFQ1NbdnmA= MIME-Version: 1.0 Received: by 10.146.248.18 with SMTP id v18mr1880489yah.20.1316421204287; Mon, 19 Sep 2011 01:33:24 -0700 (PDT) Received: by 10.147.41.10 with HTTP; Mon, 19 Sep 2011 01:33:24 -0700 (PDT) In-Reply-To: <4E769418.6040200@sugarcrm.com> 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> Date: Mon, 19 Sep 2011 10:33:24 +0200 Message-ID: To: Stas Malyshev Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] __constructor parameter limitations. From: pierre.php@gmail.com (Pierre Joye) On Mon, Sep 19, 2011 at 3:00 AM, Stas Malyshev wrote: > Hi! > > On 9/18/11 5:42 PM, Pierre Joye wrote: >> >> But this exact example works, only the similar case using abstract >> will fail, and it makes to fail here as an abstract method is only the > > It produces E_STRICT for regular functions, but for some reason not for > ctors, but fatal error for abstract ctors. Quite weird. > >> declaration, the implementation being done in the child class (bar >> extends foo). This is the concept of 'abstract', see it like the >> declaration and implementation in C. The PHP documentation is also > > No, it's not at all like declaration and implementation in C. In C, > declaration and implementation relate to the SAME entity. In PHP, abstract > method and its (multiple, inependent) implementations are different > entities. Moreover, this is prohibited too: It is the same in C. A class extending an abstract class (or method) does not extend it per se but implement it. Just like the foo(int a, float b); is the declaration (abstract) and foo(int a, float b) { return a * b;= the extended class. This is the basic of abstract methods/classes. > This makes absolutely no sense, as there's no reason why MoreExtendedClass > can't extend domain of ExtendedClass. However, for some reason it is > prohibited. Not willing to understand the declaration idea will only block this thread forever. -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org