Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8156 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24059 invoked by uid 1010); 26 Feb 2004 07:59:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 24033 invoked from network); 26 Feb 2004 07:59:04 -0000 Received: from unknown (HELO spawn.leetspeak.org) (217.28.101.185) by pb1.pair.com with SMTP; 26 Feb 2004 07:59:04 -0000 Received: from leetspeak.org (gate.zwonet.de [217.28.101.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by spawn.leetspeak.org (Postfix) with ESMTP id A641256933 for ; Thu, 26 Feb 2004 08:59:43 +0100 (CET) Message-ID: <403DA6B3.3030003@leetspeak.org> Date: Thu, 26 Feb 2004 08:56:35 +0100 User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net References: <1077748616.685.16.camel@localhost> In-Reply-To: <1077748616.685.16.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 with that of Foo::__construct() From: cm@leetspeak.org (Michael Walter) Timm Friebe wrote: > thekid@friebes:~/devel/php/tests > cat inheritance.php > class Foo { > function __construct($foo) { > } > } > > class Bar extends Foo { > function __construct($foo, $bar) { > // Add = NULL after $bar to make it work > } > } > ?> > thekid@friebes:~/devel/php/tests > php-dev inheritance.php > > Fatal error: Declaration of Bar::__construct() must be compatible with > that of Foo::__construct() in > /usr/home/thekid/devel/php/tests/inheritance.php on line 10 > > Is this really necessary? If that error still occurs if you explicitely call the parent's __construct (from the derived __construct), that's a bug IMO. It's totally understandable to get such an error message in the case the parent constructor gets called implicitely, but for an explicit call there should neither be a warning or an error . Cheers, Michael