Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7892 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52107 invoked by uid 1010); 16 Feb 2004 21:35:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 52063 invoked from network); 16 Feb 2004 21:35:20 -0000 Received: from unknown (HELO shiva.mind.de) (212.42.230.204) by pb1.pair.com with SMTP; 16 Feb 2004 21:35:20 -0000 Received: from [192.168.1.100] (p508EA9C0.dip.t-dialin.net [80.142.169.192]) by shiva.mind.de (Postfix) with ESMTP id 8B14197B59; Mon, 16 Feb 2004 22:35:14 +0100 (CET) Date: Mon, 16 Feb 2004 22:35:28 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <174510909453.20040216223528@marcus-boerger.de> To: Hans Lellelid Cc: zeev@zend.com, Hans Lellelid , internals@lists.php.net In-Reply-To: <40313129.8060704@appliedsec.com> References: <40305B44.20002@velum.net> <5.1.0.14.2.20040216113631.06f80cd8@localhost> <40313129.8060704@appliedsec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] extending interfaces - fringe behavior From: helly@php.net (Marcus Boerger) Hello Hans, Monday, February 16, 2004, 10:07:53 PM, you wrote: > Hi - > Zeev Suraski wrote: >> At 07:55 16/02/2004, Hans Lellelid wrote: >> >>> I have a need in a current application to extend interfaces and >>> possibly re-define (change signature) some of the inherited methods in >>> the child interface. >> ... >> >> >> You're not supposed to change the signature when you're >> extending/implementing interfaces. I'll try to see if it's feasible to >> improve the checks so that they compare signatures in a smarter way >> (i.e., func($arg1, $arg2=null) is compatible with func($arg1), and >> currently it's not detected that way). >> > Yeah, I realize that wanting to change signatures of parent interfaces > is a little weird; I'd submit that it does allow for some nice design > possibilities -- but perhaps modifying an interface is at odds with the > idea of an interface. I think I probably want to just copy & paste the > methods that are the same rather than extend. > Making it possible to re-define methods w/ additional null params would > be nice if that makes sense. In C++ overwritten default value of derived classes are ignored because the binding happens at compile time and the default values would have been evaluated at run time to work as expected. Now PHP is different. We would have the default values at runtim and compile time and the problem is only inheriting the methods. Currently NULL matches any time so it could work. Zeev maybe this is something worth to verify? Best regards, Marcus mailto:helly@php.net