Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49455 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51963 invoked from network); 19 Aug 2010 13:57:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2010 13:57:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=ionut.g.stan@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ionut.g.stan@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ionut.g.stan@gmail.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:49743] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B1/B3-28424-3683D6C4 for ; Thu, 19 Aug 2010 09:57:56 -0400 Received: by fxm14 with SMTP id 14so1239130fxm.29 for ; Thu, 19 Aug 2010 06:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=+MB1FIiI9aRteTx+cvqwrbtQur42OiJAd+51ytGfaIM=; b=ae1MYwG7HN/okcurZ60LPWZakFYiY5jUcOcG7J47DVs2HGAhMZrxaq0jN6qYc7+23q JUTCDzRVIVbPxIfDhncVnl8dqPHzgzHJtL13HY0nlP7I2YhJC1+pBdZkuOTxZvbNqCzT k9k3a40s7N+ct0EgeDlqAIIj/NYz74YhirD/I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=Jif1yY8pBOwyBeiGmMLPujbr/t8nErVn7KhD5KPRqil61lQTsLJNGhJPpjT7ERwBgC PoZulrD1nq9pE3zM9SBDwMLWvcDVw0QlOUsREqrh4gM24kqYbg8tGOC4WXXEE/zYXUln YccVEKvpYOxe3Jcnt/XLVM+4s/XF2SJ/AIQk8= Received: by 10.223.119.10 with SMTP id x10mr9453097faq.1.1282226273240; Thu, 19 Aug 2010 06:57:53 -0700 (PDT) Received: from l.local ([82.76.132.251]) by mx.google.com with ESMTPS id f28sm671919faa.24.2010.08.19.06.57.51 (version=SSLv3 cipher=RC4-MD5); Thu, 19 Aug 2010 06:57:52 -0700 (PDT) Message-ID: <4C6D39EA.4000705@gmail.com> Date: Thu, 19 Aug 2010 17:04:26 +0300 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: internals@lists.php.net References: <4C6CE273.2070501@sugarcrm.com> <4C6CE604.1010209@dmi.me.uk> <4C6CE793.1020601@sugarcrm.com> <1282206735.2561.11.camel@guybrush> <4C6CF898.5060706@gmail.com> <4C6D2EB8.30700@gmail.com> In-Reply-To: <4C6D2EB8.30700@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] inheritance check too strict? From: ionut.g.stan@gmail.com ("Ionut G. Stan") On 19/Aug/10 4:16 PM, Ryan Panning wrote: > Nathan Rixham wrote: >> what if Bar implements Foo, or Bar extends Foo - surely that should be >> compatible given the inheritance chain. > > I ran into this exact issue and thought it was strange. Is there a > reason this shouldn't be allowed? It still breaks the interface: class Parent { public function foo(Foo $foo) {} } class Child { public function foo(Bar $bar) {} } class Foo {} class Bar extends Foo {} All fine until here, but what if... class Taz extends Foo. {} I can't call Child::foo() with an instance of Taz, but I can call Parent::foo() with such an instance. So, I can't use instances of Child wherever instances of Parent would be accepted. -- IonuČ› G. Stan | http://igstan.ro