Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82659 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47077 invoked from network); 14 Feb 2015 02:22:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2015 02:22:33 -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.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:52683] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/65-15073-561BED45 for ; Fri, 13 Feb 2015 21:22:32 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 2A6B32400D3; Fri, 13 Feb 2015 21:22:27 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xlVnCCwAhf9M; Fri, 13 Feb 2015 21:22:27 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 827232400C7; Fri, 13 Feb 2015 21:22:26 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) In-Reply-To: Date: Sat, 14 Feb 2015 02:22:23 +0000 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Nikita Popov X-Mailer: Apple Mail (2.2070.6) Subject: Re: [PHP-DEV] Allow dropping typehints during inheritance From: ajf@ajf.me (Andrea Faulds) Hi,=20 I=E2=80=99m coming back to this thread after some discussions about = related matters off-list. I=E2=80=99m firmly convinced this is a good = idea, now: * It would be very useful to extend the callable type hint to support = typed parameters and return types. If we were to do so, its validation = rules should follow inheritance=E2=80=99s. It would be really = unfortunate if you couldn=E2=80=99t pass an untyped callback to a = callable with typed parameters. * With the Scalar Type Hints RFCs, and other future RFCs, more type = hints may be added to the language. It=E2=80=99d be a shame if existing = interfaces couldn=E2=80=99t have type hints added to them. * Contravariance is widely accepted as being sound for parameter types.=20= * We already have covariance for return type existence. So why not = contravariance for parameter type existence? I hope we can have this added. -- Andrea Faulds http://ajf.me/