Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37293 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89326 invoked from network); 29 Apr 2008 13:39:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2008 13:39:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=sam@sambarrow.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sam@sambarrow.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sambarrow.com from 208.70.128.77 cause and error) X-PHP-List-Original-Sender: sam@sambarrow.com X-Host-Fingerprint: 208.70.128.77 smtp-gw51.mailanyone.net Received: from [208.70.128.77] ([208.70.128.77:49248] helo=smtp-gw51.mailanyone.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F1/A3-03498-A0527184 for ; Tue, 29 Apr 2008 09:39:22 -0400 Received: from mailanyone.net by smtp-gw51.mailanyone.net with esmtpsa (TLSv1:RC4-MD5:128) (MailAnyone extSMTP sam@sambarrow.com) id 1Jqq3D-0005Ca-B4 for internals@lists.php.net; Tue, 29 Apr 2008 08:39:19 -0500 To: internals@lists.php.net In-Reply-To: <1209476047.3257.2.camel@sbarrow-desktop> References: <1209476047.3257.2.camel@sbarrow-desktop> Content-Type: text/plain Date: Tue, 29 Apr 2008 09:35:50 -0400 Message-ID: <1209476150.3257.4.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 09:34 -0400, Sam Barrow wrote: > I want to make two classes: > > abstract class a { > abstract public function go($a); > } > final class b extends a { > abstract public function go(array $a); > } > Sorry, function in class b should not be abstract. > 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? > > Ie, I can do the above, but not the following: > > abstract class a { > abstract public function go(myClass $a); > } > final class b extends a { > abstract public function go(array $a); > } > Same, function in class b should not be abstract.