Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37299 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21619 invoked from network); 29 Apr 2008 15:43:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2008 15:43:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=et@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=et@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 62.75.137.136 as permitted sender) X-PHP-List-Original-Sender: et@php.net X-Host-Fingerprint: 62.75.137.136 fuer-et.de Linux 2.5 (sometimes 2.4) (4) Received: from [62.75.137.136] ([62.75.137.136:35493] helo=eve.fuer-et.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3A/95-26601-92247184 for ; Tue, 29 Apr 2008 11:43:38 -0400 Received: from lapalma.mis.informatik.tu-darmstadt.de (lapalma.mis.informatik.tu-darmstadt.de [130.83.165.195]) by eve.fuer-et.de (Postfix) with ESMTP id 756DD1C59E5A for ; Tue, 29 Apr 2008 15:43:30 +0000 (UTC) To: internals@lists.php.net User-Agent: KMail/1.9.7 References: <1209476047.3257.2.camel@sbarrow-desktop> In-Reply-To: <1209476047.3257.2.camel@sbarrow-desktop> MIME-Version: 1.0 Content-Disposition: inline X-Length: 1315 X-UID: 58 Date: Tue, 29 Apr 2008 17:43:22 +0200 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <200804291743.22503.et@php.net> Subject: Re: [PHP-DEV] Inheritance/compatibility behavior From: et@php.net (Stefan Walk) On Tuesday 29 April 2008 15:34:07 Sam Barrow wrote: > This will not work, I get an error that the two must be compatible. > Wouldn't it be a good idea to allow any type hint for a parameter that > does not specify a type hint? That would be a bad idea, because it violates a (in my opinion, the) core principle of OO: If B inherits from A, anything I can do with A (i.e. pass an int to the method go) I can do with B. http://en.wikipedia.org/wiki/Liskov_substitution_principle Regards, Stefan P.S. Sorry if this pops up twice, used the wrong from: address at first ...