Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9366 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91317 invoked by uid 1010); 19 Apr 2004 10:04:37 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 91197 invoked from network); 19 Apr 2004 10:04:37 -0000 Received: from unknown (HELO mail.zend.com) (192.117.235.230) by pb1.pair.com with SMTP; 19 Apr 2004 10:04:37 -0000 Received: (qmail 29796 invoked from network); 19 Apr 2004 10:04:30 -0000 Received: from localhost (HELO zeev-laptop-new.zend.com) (127.0.0.1) by localhost with SMTP; 19 Apr 2004 10:04:30 -0000 Reply-To: zeev@zend.com Message-ID: <5.1.0.14.2.20040419130347.04ddeec8@localhost> X-Sender: zeev@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Mon, 19 Apr 2004 13:04:30 +0300 To: Christian Schneider Cc: internals@lists.php.net In-Reply-To: <4083A36C.7040801@cschneid.com> References: <5.1.0.14.2.20040419112627.03efaa00@localhost> <5.1.0.14.2.20040419112627.03efaa00@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: Interface inheritance From: zeev@zend.com (Zeev Suraski) At 13:01 19/04/2004, Christian Schneider wrote: >Zeev Suraski wrote: >>Any method that implements (directly or indirectly) an interface method >>or an abstract method, will have implementation checks fully enforced, >>with an E_COMPILE_ERROR emitted in case of an error. > >Excuse my ignorance: What is defined as fully implementing the interface? >I guess all methods have to be implemented with all the parameters having >the same type if specified, right? What about extending the parameter set, >especially with default values? >E.g. is foo(A $a, $newparam = 'false) valid for foo(A $a)? This is valid. As long as you *can* call the function using the same prototype as the one in the interface, it's considered to be compatible. You can extend it using default values. Zeev