Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75479 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15560 invoked from network); 14 Jul 2014 15:49:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jul 2014 15:49:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; 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:55663] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5F/15-25444-D0CF3C35 for ; Mon, 14 Jul 2014 11:49:33 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 0AE1F2400D1; Mon, 14 Jul 2014 11:49:30 -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 MuYx2ihFz3_6; Mon, 14 Jul 2014 11:49:29 -0400 (EDT) Received: from [192.168.0.15] (unknown [90.210.122.167]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 681D62400C7; Mon, 14 Jul 2014 11:49:27 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <3aa29e080d70c843713e19a952dfbad6@mail.gmail.com> Date: Mon, 14 Jul 2014 16:49:24 +0100 Cc: Rowan Collins , internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <53C3F70A.7010706@gmail.com> <3aa29e080d70c843713e19a952dfbad6@mail.gmail.com> To: Zeev Suraski X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: ajf@ajf.me (Andrea Faulds) On 14 Jul 2014, at 16:46, Zeev Suraski wrote: > Actually there's a pretty simple way that's not strict type hints: >=20 > 5) Add type hints using existing syntax, which are casts; Change = casts > (both existing and these new ones) to emit a new E_CAST in case of = data > loss or 'bogus' conversions. How is emitting a new E_CAST useful? Most people are not going to write = error handlers that will act on it, so it=92ll just be an E_WARNING so = far as most people care, and we=92ll just end up with casts, which you = can already do: function foo($a) { $a =3D (int)$a; } -- Andrea Faulds http://ajf.me/