Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75590 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3350 invoked from network); 16 Jul 2014 12:41:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2014 12:41:16 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.182 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.182 mail-we0-f182.google.com Received: from [74.125.82.182] ([74.125.82.182:49164] helo=mail-we0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 36/11-31820-AE276C35 for ; Wed, 16 Jul 2014 08:41:15 -0400 Received: by mail-we0-f182.google.com with SMTP id q59so826292wes.13 for ; Wed, 16 Jul 2014 05:41:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=vSolGVWEkxma08PecF/1xskfbPH/B1/mdfehyKo3ToI=; b=n7T81ZHhnW0suwzIN4f8kOu1W7PBSMb1DRYxvsJlu+f45mS7TaieOeUi5x4ga4FlV7 GiPZO5OMKDCTCCPMvzDnao6pNnuG7zLjtLYI/J5txy+UihiOf304wU3pNMBuT4pNea7c 1hzS7FaxI5tcdNnnLejJyjMDzdcEBICvu3YWb6BtpiZc3PcTbxeCy4aOLmEEMz3FkCQ6 aK4pkYqn2r/nGlbd3nm37vKFoejOgWMeL+a1LL7tnx6Pj0Z8xgWt7rGsA6ENXweODkww QFGjligr3/HT3dUwVSzzzAKLl5rk7WR2xJXjanzW98syWdxsym9JrOZj8Qfp8Ck9R6Dr TV3A== X-Received: by 10.180.126.8 with SMTP id mu8mr13291047wib.10.1405514467929; Wed, 16 Jul 2014 05:41:07 -0700 (PDT) Received: from [192.168.0.139] ([62.189.198.114]) by mx.google.com with ESMTPSA id v17sm39535480wjr.33.2014.07.16.05.41.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Jul 2014 05:41:07 -0700 (PDT) Message-ID: <53C67265.5010201@gmail.com> Date: Wed, 16 Jul 2014 13:39:01 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: internals@lists.php.net 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> In-Reply-To: <60f496756412de6ad97751d91ead5058@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: rowan.collins@gmail.com (Rowan Collins) Zeev Suraski wrote (on 16/07/2014): > But there too, they'd have consistency, just one set of rules for > implicit cast of scalar values across all of PHP. The way I see it is that there's an existing set of rules for the result of any cast, implicit or explicit; these are in some cases "lossy". Various proposals here rely on a separate set of rules, which doesn't modify the *result* of any casts, but *checks* that the cast will be "lossless". The RFC as drafted proposes using these new checks in one specific place (function calls when declared with type hints) and with a particular outcome (catchable error). As far as I understand it, you propose defining *the same set of rules*, but applying them in a different place (whenever an implicit cast occurs) with a different outcome (emit a new E_CAST message). > The proposal currently on the table implements two, simultaneously active > sets of rules that in the long run everyone will have to be aware of. It > has both the lossy and lossless concepts active in the same time, which > means everyone will have to become familiar with the lossless rules, whether > he's interested in that or not. Right, so it's not actually about the existence of the rules, just the likelihood that someone will be able to ignore them? Someone writing code from scratch can, of course, not use any type hints, and so ignore the checks either way, but I guess if some project or library adopts them, developers will need to learn how they work to interact with that project/library.