Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75481 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19554 invoked from network); 14 Jul 2014 16:12:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jul 2014 16:12:36 -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.199 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.199 imap11-2.ox.privateemail.com Received: from [192.64.116.199] ([192.64.116.199:38815] helo=imap11-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 70/F5-25444-37104C35 for ; Mon, 14 Jul 2014 12:12:36 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 48E948800F3; Mon, 14 Jul 2014 12:12:33 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap11.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap11.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id rbJ56_-AHb_0; Mon, 14 Jul 2014 12:12:33 -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 D764D8800CB; Mon, 14 Jul 2014 12:12:31 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <3b06c592b0b88bb95d3ae7ea7a93d86f@mail.gmail.com> Date: Mon, 14 Jul 2014 17:12:27 +0100 Cc: Rowan Collins , internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <6AF150D1-1398-43CA-977A-3CF3D51719F4@ajf.me> References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <53C3F70A.7010706@gmail.com> <3aa29e080d70c843713e19a952dfbad6@mail.gmail.com> <3b06c592b0b88bb95d3ae7ea7a93d86f@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 17:04, Zeev Suraski wrote: > 1. It saves a bit of code and improves readability for a *very* common = use > case. Sure. > 2. It encourages developers to get the types straight instead of = relying > on implicit casts. Your proposal is to just use implicit casts with no real failure cases; = isn=92t that encouraging developers not to care about using the correct = types? This RFC=92s proposal is quite strict, what you are suggesting is = very loose and will not encourage anyone to use the correct types, as it = is very tolerant. > 3. It reuses syntax we already use for type hinting so it doesn't = drive > complexity up significantly. As does this RFC. > 4. It allows people to go extra strict very easily, by turning E_CASE = into > errors. My guesstimate is that the majority of people won't, but = it'll be > possible and easy to do nonetheless. I really don=92t like that idea. If someone writes a function with type = hints, people shouldn=92t be able to make those type hints go away or = become more or less strict. They should be consistent across = environments and contexts. -- Andrea Faulds http://ajf.me/