Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75592 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9376 invoked from network); 16 Jul 2014 14:03:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2014 14:03:49 -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:43144] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/E1-31820-44686C35 for ; Wed, 16 Jul 2014 10:03:49 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 2994CB00087; Wed, 16 Jul 2014 10:03:46 -0400 (EDT) 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 d4l_BbhQTtbi; Wed, 16 Jul 2014 10:03:45 -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 B3DA4B0008B; Wed, 16 Jul 2014 10:03:44 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <60f496756412de6ad97751d91ead5058@mail.gmail.com> Date: Wed, 16 Jul 2014 15:03:41 +0100 Cc: Rowan Collins , internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <16D48604-0C0A-4613-91A4-21392E3A2636@ajf.me> <05CE2216-C5D9-4937-9F2E-AA1407284D9F@ajf.me> <53C460DF.5040304@sugarcrm.com> <53C53A96.2040303@gmail.com> <53C55342.1010207@sugarcrm.com> <53C563B3.6060905@gmail.com> <54536191-1B92-4933-973F-0C8289D13A4C@ajf.me> <00d12255efc53466245b21a83ff7d474@mail.gmail.com> <53C652FA.6010704@gmail.com> <53C66D6E.9060200@gmail.com> <60f496756412de6ad97751d91ead5058@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 16 Jul 2014, at 13:28, Zeev Suraski wrote: > It's more of a lossy cast, exactly as we have today, that has an > (effectively-optional-since-it's-off-by-default) to warn you about = loss of > data. > For the vast majority of users who use the defaults, there'll be = nothing new > to learn except for the availability of those implicit casts in = function > signatures. > For those who want to take advantage of 'loss protection', they'd have = to > learn about this extra warning type and clean their code so that it = adheres > to it. But there too, they'd have consistency, just one set of rules = for > implicit cast of scalar values across all of PHP. The problem with making this RFC do the lossy thing is it then removes = one key advantage of it: that this RFC provides a measure of strictness. = Without that, we have no real compromise proposal, and we might as well = introduce a second set of =93strict=94 type hints. The whole point of = the current behaviour is that it compromises between the weak typing and = strict typing camps; doing what zpp does is giving in to the former = camp, and then it=92s not a compromise any more, is it? -- Andrea Faulds http://ajf.me/