Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8139 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61295 invoked by uid 1010); 26 Feb 2004 02:04:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 61233 invoked from network); 26 Feb 2004 02:04:38 -0000 Received: from unknown (HELO moutng.kundenserver.de) (212.227.126.171) by pb1.pair.com with SMTP; 26 Feb 2004 02:04:38 -0000 Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1AwAtB-0000wx-00 for internals@lists.php.net; Thu, 26 Feb 2004 03:04:37 +0100 Received: from [80.139.1.157] (helo=[80.139.1.157]) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1AwAtB-0003WX-00 for internals@lists.php.net; Thu, 26 Feb 2004 03:04:37 +0100 To: internals@lists.php.net In-Reply-To: <1077758027.685.109.camel@localhost> References: <1077748616.685.16.camel@localhost> <1781292779406.20040225234401@marcus-boerger.de> <1077749539.685.27.camel@localhost> <1077752071.685.57.camel@localhost> <1721299626562.20040226013808@marcus-boerger.de> <1077758027.685.109.camel@localhost> Content-Type: multipart/mixed; boundary="=-IeTyHlLcTKvsdBh1fHsw" Message-ID: <1077760808.685.140.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 26 Feb 2004 03:00:08 +0100 X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:e958292ea7b1c44e51b2b9ca0a9da460 Subject: Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible with that of Foo::__construct() From: thekid@thekid.de (Timm Friebe) --=-IeTyHlLcTKvsdBh1fHsw Content-Type: text/plain Content-Transfer-Encoding: 7bit On Thu, 2004-02-26 at 02:13, Timm Friebe wrote: > On Thu, 2004-02-26 at 01:38, Marcus Boerger wrote: > > Hello Timm, > [...] > > > Should work #1, Bar::connect() adds an argument > > No the sugnature is incompatible. An instance of Foo cannot be called > > with Bar or Connector's connect() Signature. Hence Bar is not a Foo > > or Connector. > > Hrm, that's quite a (huge) BC break then. Maybe we'd all be happier with an E_STRICT warning for inheritance and an E_COMPILE_ERROR for interfaces implementation. - Timm --=-IeTyHlLcTKvsdBh1fHsw Content-Disposition: attachment; filename=zend_compile.diff Content-Type: text/x-patch; name=zend_compile.diff; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Index: Zend/zend_compile.c =================================================================== RCS file: /repository/ZendEngine2/zend_compile.c,v retrieving revision 1.547 diff -u -r1.547 zend_compile.c --- Zend/zend_compile.c 25 Feb 2004 17:23:50 -0000 1.547 +++ Zend/zend_compile.c 26 Feb 2004 01:34:10 -0000 @@ -1828,8 +1828,19 @@ } } + /* Perform implementation check. When implementing an interface and the + * check fails, this will result in a fatal error. When inheriting, + * we'll issue an E_STRICT warning, but will continue. + */ if (!zend_do_perform_implementation_check(child)) { - zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name); + zend_error( + child->common.prototype->common.scope->ce_flags & ZEND_ACC_INTERFACE ? E_COMPILE_ERROR : E_STRICT, + "Declaration of %s::%s() must be compatible with that of %s::%s()", + ZEND_FN_SCOPE_NAME(child), + child->common.function_name, + ZEND_FN_SCOPE_NAME(child->common.prototype), + child->common.prototype->common.function_name + ); } return 0; --=-IeTyHlLcTKvsdBh1fHsw--