Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49883 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68405 invoked from network); 7 Oct 2010 08:03:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Oct 2010 08:03:24 -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.214.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.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:45997] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 66/FB-06116-8CE7DAC4 for ; Thu, 07 Oct 2010 04:03:24 -0400 Received: by bwz5 with SMTP id 5so297230bwz.29 for ; Thu, 07 Oct 2010 01:03:15 -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:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=cumNxoVC/0YT2rUgC71lwAr3cARo+mNcAijddfI4DoI=; b=OcMenJ1B6Wnjafx/fVGfyZtzczg7ftVspk2XFhy8cQPrW60Dl5f5xt8IXtTnkyIZbI APopMwUwpHLsSf3JswsQbAJ1aYwQl7sfuJg+JNJ1zm5GJhNlA3mn0LHYzw/KNEqDgmg/ IFQHk+S8ajuZPkc72g3jgwJdMVKRpjepYakZs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=dL6eeUUm1Y3YJi4+yAXCgvIAsYQlYb+zP8Po9TEE4BTodTokwM2aswAokobDaWycvT qFO3B8q/elyjA2CeGZQqYpKvLfhJG2ZkRqGTfOBPVz6+o82Qa+bXPnep7Gmdw1V4FaBy Dt5wfFd/+sIpO+wueUM1A/0Jco6Lp1nc1YbG4= Received: by 10.204.177.79 with SMTP id bh15mr363700bkb.121.1286438594736; Thu, 07 Oct 2010 01:03:14 -0700 (PDT) Received: from l.local ([82.76.132.251]) by mx.google.com with ESMTPS id s34sm1398703bkk.13.2010.10.07.01.03.11 (version=SSLv3 cipher=RC4-MD5); Thu, 07 Oct 2010 01:03:12 -0700 (PDT) Message-ID: <4CAD7EAF.3030506@gmail.com> Date: Thu, 07 Oct 2010 11:02:55 +0300 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: internals@lists.php.net CC: Nathan Nobbe References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Using child classes/interfaces as desired type hints From: ionut.g.stan@gmail.com ("Ionut G. Stan") On 07/Oct/10 8:56 AM, Nathan Nobbe wrote: > Hi, > > Probly rehashing an old conversation here, but I'm wondering why the > following isn't supported > > abstract class AbstractServer {} > class ConcreteServer extends AbstractServer {} > > abstract class AbstractClient { > abstract function doStuff(AbstractServer $o); > } > > class ConcreteClient extends AbstractClient { > function doStuff(ConcreteServer $o) {} > } > ?> Here's the problem: class ConcreteServer2 extends AbstractServer {} Now, ConcreteClient can't receive an instance of ConcreteServer2 as an argument, although the initial hint, AbstractServer would have allowed it. -- IonuČ› G. Stan | http://igstan.ro