Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78110 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98745 invoked from network); 16 Oct 2014 10:58:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Oct 2014 10:58: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:56521] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/A2-11594-6D4AF345 for ; Thu, 16 Oct 2014 06:58:32 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 79F542400DC; Thu, 16 Oct 2014 06:58:27 -0400 (EDT) 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 IPy_NC1E9fNd; Thu, 16 Oct 2014 06:58:27 -0400 (EDT) Received: from oa-res-26-28.wireless.abdn.ac.uk (oa-res-26-28.wireless.abdn.ac.uk [137.50.26.28]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 2199624005D; Thu, 16 Oct 2014 06:58:25 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: Date: Thu, 16 Oct 2014 11:58:23 +0100 Cc: internals Content-Transfer-Encoding: quoted-printable Message-ID: <38AD5222-CC19-4697-9F1A-B5AD21DB4C79@ajf.me> References: To: Levi Morrison X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] RFC: Return Types Update From: ajf@ajf.me (Andrea Faulds) On 16 Oct 2014, at 05:39, Levi Morrison wrote: > - There is a new section about disallowing return types on certain = methods[4]. Perhaps, along the same lines, we could error if you use a nonsensical = type hint for magic methods? For example, allow this: class FooBar { public function __debugInfo(): array { return [=92test=92]; } } But not this: class FooBar { public function __debugInfo(): callable { return [=92test=92]; } } It=92s not strictly necessary, but it would catch out bugs at = =93compile-time=94 (i.e. script startup) rather than call-time. -- Andrea Faulds http://ajf.me/