Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97455 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40904 invoked from network); 22 Dec 2016 14:35:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Dec 2016 14:35:29 -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.221 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.221 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.221] ([81.169.146.221:18203] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/75-36089-EA4EB585 for ; Thu, 22 Dec 2016 09:35:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1482417324; l=3385; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=LkkL+hpEiGwihFoJQ9p6outlqc+Myi+Pvfm0uRGOwps=; b=mzIUqDR3p42c9jGtW6/fsE19J2NknmhtcuWuVvHRzf3wuqbqrg72hQximbRJ7J0bSj q6p2h5zJRbUdWLbC5feipOHcSh5jGlqKmuR4nDihCK4z75pEzRoNlMVieq6Mo8bCf08c wRKeo9mtW48XelFE4NYe2Stjk8wvNgPtr/CUU= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLDup6E67mzuoNJBqD/tmQ= X-RZG-CLASS-ID: mo00 Received: from mail-qt0-f176.google.com ([209.85.216.176]) by smtp.strato.de (RZmta 39.11 AUTH) with ESMTPSA id L08dd8sBMEZOFpU (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 ; Thu, 22 Dec 2016 15:35:24 +0100 (CET) Received: by mail-qt0-f176.google.com with SMTP id d45so14036044qta.1 for ; Thu, 22 Dec 2016 06:35:23 -0800 (PST) X-Gm-Message-State: AIkVDXINsMp5E/1u76C2pC55zIrsSMRBl9SHjIKLcW16VyCFrK7C0+r1LVCRz6BO9leWzp5OjYhbURhkWqwYow== X-Received: by 10.200.36.125 with SMTP id d58mr9730762qtd.126.1482417323351; Thu, 22 Dec 2016 06:35:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.141.204 with HTTP; Thu, 22 Dec 2016 06:35:22 -0800 (PST) In-Reply-To: References: Date: Thu, 22 Dec 2016 15:35:22 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Nikita Popov Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11402a16f7baea0544402d52 Subject: Re: [PHP-DEV] [RFC] Parameter No Type Variance From: me@kelunik.com (Niklas Keller) --001a11402a16f7baea0544402d52 Content-Type: text/plain; charset=UTF-8 > > The RFC is a bit lacking in motivation ... > > The main practical use-case I see for this is post-hoc addition of > type-hints on an interface. To cite a particular example we ran into for > PHP 7.0: Derick added a DateTimeZone type hint for the third arg of the > DateTime::createFromFormat() method [1]. The method is already documented > to accept only this class in the manual, but the typehint is not actually > present in the implementation. > > However, this change had to be reverted, because all classes extending > DateTime currently don't have this typehint (and adding it would be illegal > under LSP), so they started throwing a method signature mismatch warning. > > Allowing extending classes to drop typehints in accordance with > variance-rules allow people to add additional parameter typehints on parent > classes without breaking BC. (Adding an additional return typehint would > break BC, but it is still a cross-version compatible change, as consumers > have the possibility of writing code that is valid under both versions -- > something that is currently impossible if you want to add parameter > typehints.) > You're completely right, I'll add that before I start the vote. I think it makes sense to defer the vote into the next year, we still have plenty of time then. Regards, Niklas --001a11402a16f7baea0544402d52--