Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37301 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23845 invoked from network); 29 Apr 2008 15:45:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2008 15:45:27 -0000 Authentication-Results: pb1.pair.com header.from=sam@sambarrow.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=sam@sambarrow.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sambarrow.com from 208.70.128.104 cause and error) X-PHP-List-Original-Sender: sam@sambarrow.com X-Host-Fingerprint: 208.70.128.104 smtp-gw78.mailanyone.net Received: from [208.70.128.104] ([208.70.128.104:45303] helo=smtp-gw78.mailanyone.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3C/16-26601-79247184 for ; Tue, 29 Apr 2008 11:45:27 -0400 Received: from mailanyone.net by smtp-gw78.mailanyone.net with esmtpsa (TLSv1:RC4-MD5:128) (MailAnyone extSMTP sam@sambarrow.com) id 1Jqs1E-0001Jk-VW; Tue, 29 Apr 2008 10:45:25 -0500 To: Stefan Walk Cc: internals@lists.php.net In-Reply-To: <200804291743.22503.et@php.net> References: <1209476047.3257.2.camel@sbarrow-desktop> <200804291743.22503.et@php.net> Content-Type: text/plain Date: Tue, 29 Apr 2008 11:41:55 -0400 Message-ID: <1209483715.3257.14.camel@sbarrow-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Inheritance/compatibility behavior From: sam@sambarrow.com (Sam Barrow) On Tue, 2008-04-29 at 17:43 +0200, Stefan Walk wrote: > 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 Yes this was my only doubt about it. > Regards, > Stefan > > P.S. Sorry if this pops up twice, used the wrong from: address at first ... >