Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79268 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20712 invoked from network); 28 Nov 2014 10:57:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Nov 2014 10:57:54 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:58195] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/29-59154-13558745 for ; Fri, 28 Nov 2014 05:57:53 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 99309B00068; Fri, 28 Nov 2014 05:57:50 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id pLrBGhSAYCib; Fri, 28 Nov 2014 05:57:50 -0500 (EST) Received: from [10.129.4.85] (dab-yat1-h-27-9.dab.02.net [82.132.215.103]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 8EA04B00058; Fri, 28 Nov 2014 05:57:49 -0500 (EST) References: <5477010E.4000000@gmail.com> Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-ID: <493B6453-6597-41CC-9409-52F999E19A32@ajf.me> Cc: Rowan Collins , Levi Morrison , PHP Internals X-Mailer: iPhone Mail (12B435) Date: Fri, 28 Nov 2014 10:57:44 +0000 To: Dmitry Stogov Subject: Re: [PHP-DEV] [RFC][Discussion] Return Type Variance Checking From: ajf@ajf.me (Andrea Faulds) > On 28 Nov 2014, at 09:31, Dmitry Stogov wrote: >=20 > I prefer option (3) - invariant return types. > Actually, return type compatibility check should follow all the rules for > parameter type compatibility check (may be even reuse or share the code). No, it shouldn't match parameters, that'd break type safety. What's safe for= parameters is the opposite of what's safe for return types. The exception i= s invariance, which is safe for both. -- Andrea Faulds http://ajf.me/=