Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8133 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41101 invoked by uid 1010); 25 Feb 2004 23:54:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 41064 invoked from network); 25 Feb 2004 23:54:09 -0000 Received: from unknown (HELO lakemtao04.cox.net) (68.1.17.241) by pb1.pair.com with SMTP; 25 Feb 2004 23:54:09 -0000 Received: from velum.net ([68.98.128.109]) by lakemtao04.cox.net (InterMail vM.5.01.06.08 201-253-122-130-108-20031117) with ESMTP id <20040225235409.OHJ24274.lakemtao04.cox.net@velum.net>; Wed, 25 Feb 2004 18:54:09 -0500 Message-ID: <403D35A0.4070102@velum.net> Date: Wed, 25 Feb 2004 18:54:08 -0500 User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Timm Friebe CC: internals@lists.php.net References: <1077748616.685.16.camel@localhost> <1781292779406.20040225234401@marcus-boerger.de> <1077749539.685.27.camel@localhost> In-Reply-To: <1077749539.685.27.camel@localhost> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible From: hans@velum.net (Hans Lellelid) Timm Friebe wrote: > On Wed, 2004-02-25 at 23:44, Marcus Boerger wrote: > >>Hello Timm, >> >>i had the same expirience today too. And also for me it makes not much >>sense. The constructor shouldn't check inheritance rules. > > > Neither should other methods follow this. What if I want to add a > non-default parameter to an overriden method? > Yes, I think this is the same issue that I brought up earlier related to interfaces. I brought it up then as an inconsistency -- i.e. that you couldn't override methods in interfaces & hence using interfaces was limiting the OO inheritance that PHP supported when not using interfaces. In brief the issue was that if you extend a class that implemented an interface the extending class (subclass) had to also implement the parent class' interface and was therefore not allowed to override methods (w/ incompatible signatures) -- and not allowed to implement a different interface which itself might specify incompatible signatures. It seems now that PHP is no longer inconsistent, but it also seems that it is impossible to override methods w/ incompatible signature. Is that a correct assessment? This is a pretty big difference from PHP4, then. Personally, I can live with it :) -- just want to make sure I understand it correctly. Thanks, Hans