Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8129 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95307 invoked by uid 1010); 25 Feb 2004 22:46:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 95283 invoked from network); 25 Feb 2004 22:46:08 -0000 Received: from unknown (HELO shiva.mind.de) (212.42.230.204) by pb1.pair.com with SMTP; 25 Feb 2004 22:46:08 -0000 Received: from [192.168.1.105] (p508EBE6F.dip.t-dialin.net [80.142.190.111]) by shiva.mind.de (Postfix) with ESMTP id 4660A97B59; Wed, 25 Feb 2004 23:46:02 +0100 (CET) Date: Wed, 25 Feb 2004 23:44:01 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1781292779406.20040225234401@marcus-boerger.de> To: Timm Friebe Cc: internals@lists.php.net In-Reply-To: <1077748616.685.16.camel@localhost> References: <1077748616.685.16.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible with that of Foo::__construct() From: helly@php.net (Marcus Boerger) 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. And as a consequence maybe interfaces shouldn't allow constructors. marcus Wednesday, February 25, 2004, 11:36:57 PM, you 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? > - Timm -- Best regards, Marcus mailto:helly@php.net