Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81968 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80093 invoked from network); 5 Feb 2015 22:34:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2015 22:34:54 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 74.125.82.179 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 74.125.82.179 mail-we0-f179.google.com Received: from [74.125.82.179] ([74.125.82.179:60211] helo=mail-we0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/0E-27691-D00F3D45 for ; Thu, 05 Feb 2015 17:34:54 -0500 Received: by mail-we0-f179.google.com with SMTP id u56so4833492wes.10 for ; Thu, 05 Feb 2015 14:34:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=oCGGE7uK8AWOQWzeDbIEnV7UtCqa6Hmxu2G3gqxr3UE=; b=cYLw0DtqcRRK5RKz8JU0mgb9dVh9jvRxSyOASPDENeh9tfZ2y2CUnqYKET4OvxprZM EEC82BGSQMBB76jdq2rrW4drbz1JXa+tkq29s0pjG6fpk38TrHOcMpNLEZxAU8M37O1/ berBU2Q72mVxpz692rEZUnUEcogQPDsUj0vE7aJBDwhkfKGqqXO7RYBC8f4Wlgs986yN i4g/Iq9OPbEN4+a+wLEoeYOCeIfBpdtgYO/imhTQhIwmFMr2Z8va7umgzMNm47qmrHek 4YR5XyvoHQ+JfIOxwNJ2Jathpe2IK4a0a3WxyQXMwP5P7EzRthXlmdxABrNU5m8+ljlW h/UA== X-Gm-Message-State: ALoCoQnAhdqLwAANR60hG4Wi3IijTArmefgO5dQuzFycIqfp3Ev/2p3iFcp77t0vmub8b640xYy1 MIME-Version: 1.0 X-Received: by 10.180.19.7 with SMTP id a7mr965218wie.62.1423175690014; Thu, 05 Feb 2015 14:34:50 -0800 (PST) Received: by 10.217.82.208 with HTTP; Thu, 5 Feb 2015 14:34:49 -0800 (PST) X-Originating-IP: [78.149.8.112] In-Reply-To: References: <4A36329B-F17B-4665-A84E-D8CF01F5B29A@ajf.me> Date: Thu, 5 Feb 2015 22:34:49 +0000 Message-ID: To: Levi Morrison Cc: Andrea Faulds , Julien Pauli , Hannes Magnusson , Nikita Popov , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Allow dropping typehints during inheritance From: danack@basereality.com (Dan Ackroyd) On 5 February 2015 at 21:52, Levi Morrison wrote: > To chime in regarding allowing contravariant parameter types: I > struggle to find use cases for it. Theoretically it would allow a class to implement two separate interfaces that would otherwise be incompatible: interface A { function foo(); } interface B implements A { function bar(B $b); } interface C implements A { function bar(C $c); }; class D implements B, C { // Any object that implements B or C must also // implement A, but only the methods from interface A // are safe to call inside the method. function bar(A $a){ $a->foo(); } function foo(){...} } But I agree, the number of times I've wanted to do this is low. cheers Dan