Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97105 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25533 invoked from network); 21 Nov 2016 10:42:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Nov 2016 10:42:58 -0000 Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.216 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.216 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.216] ([81.169.146.216:28202] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A2/D7-65233-1BFC2385 for ; Mon, 21 Nov 2016 05:42:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1479724974; l=2542; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=GpeNuRNerRrUe+sQW3/eYj/5MgvgrSQcl9EmSO9f0K8=; b=irJSPSWBP8OVMAHk75KA2/p2detRtBnTQxKCKh7euW5kHm7S3UaHoZ0oDBJ9dsSC7v 8GbrlwuBvWcIbssOqg4ZSt0OqwHisTlGXR5YPs4qa+nLK4sqB+F8TueHoBwaOTd+gE4R RI3IQwUq7sBNrhdv5C/GBpP61hkLpHlm8zvxY= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLDup6E67mzuoNPBqD+ufg= X-RZG-CLASS-ID: mo00 Received: from mail-wj0-f169.google.com ([209.85.210.169]) by smtp.strato.de (RZmta 39.9 AUTH) with ESMTPSA id j06d48sALAgsfv7 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp384r1 with 384 ECDH bits, eq. 7680 bits RSA)) (Client did not present a certificate) for ; Mon, 21 Nov 2016 11:42:54 +0100 (CET) Received: by mail-wj0-f169.google.com with SMTP id v7so24949613wjy.2 for ; Mon, 21 Nov 2016 02:42:54 -0800 (PST) X-Gm-Message-State: AKaTC03d4vWsrJr323xRng1XxF4gCzUbXLezrADVxwavOnuSGEksNhNuyykD7IakmOhxk1STbQElt12xPPPzxw== X-Received: by 10.194.191.161 with SMTP id gz1mr8719154wjc.22.1479724974374; Mon, 21 Nov 2016 02:42:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.87.70 with HTTP; Mon, 21 Nov 2016 02:42:53 -0800 (PST) In-Reply-To: <1479722400.3232818.794348273.4EB5A50D@webmail.messagingengine.com> References: <1479722400.3232818.794348273.4EB5A50D@webmail.messagingengine.com> Date: Mon, 21 Nov 2016 11:42:53 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Daniel Morris Cc: PHP Internals Content-Type: multipart/alternative; boundary=047d7b5d8bcd768cf30541cd51c9 Subject: Re: [PHP-DEV] [RFC] Parameter No Type Variance From: me@kelunik.com (Niklas Keller) --047d7b5d8bcd768cf30541cd51c9 Content-Type: text/plain; charset=UTF-8 2016-11-21 11:00 GMT+01:00 Daniel Morris : > What happens if the method signature is defined within an interface? Just the same as for every class. Having other rules for interfaces doesn't make sense. Imagine the following example: interface I { function foo(array $foo); } class C1 implements I { function foo(array $foo) { /* with your proposal, we have to keep the type here? */ } } class C2 extends C2 { function foo($foo) { /* we can suddenly drop the parameter type now?! */ } } > I would consider that method signature a contract and one that should not > be able to be overwritten. > Subtypes can always accept more than a parent by the LSP ( https://en.wikipedia.org/wiki/Liskov_substitution_principle) Regards, Niklas --047d7b5d8bcd768cf30541cd51c9--