Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75586 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92521 invoked from network); 16 Jul 2014 11:05:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2014 11:05:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.182 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 209.85.220.182 mail-vc0-f182.google.com Received: from [209.85.220.182] ([209.85.220.182:32855] helo=mail-vc0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/33-07119-76C56C35 for ; Wed, 16 Jul 2014 07:05:12 -0400 Received: by mail-vc0-f182.google.com with SMTP id hy4so1266707vcb.41 for ; Wed, 16 Jul 2014 04:05:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc:content-type; bh=Txhrgc6jQ0V4TT4NTo/sRaljAyXH27myHKQHcC2IqAU=; b=jWZucKPwIj0QxN/VTFdld3M/rNiCZNH3Q0tt4q+Sz9hftF051HwnyRe1Kh6o6BWp22 cq0hF9O+dDV5wN888ycvj1YS1zmVoQESM7W2+L7Gll9dpq17eR2CbzazC64JxwfqvetK HI4oTyPj6DbT79DMfQkXxY3JMT1aLaHeA50313TtlGuP1hs8MPDN3coWoR/mZsZ94AwX +3HNlXSzWq8b+iJKmFs/E7iFCNKx+o1fjii+gau+UqObES+yVqQkRY1IgLr7HdxFq/4R Fvfb4JSzueJD+PL5kPgUkhpispwPncbZougDE3qboVtTtrBqqWBSexv92NwwQeo9Ek7s 2KMg== X-Gm-Message-State: ALoCoQlacTIF8IR/0IiL80Tp2wNQMTPEhMAkgndhazCr/eK/8W0qd618oJFR6x2wJDeGjNeIUF3jwE0PSPubGBiqP/gzWxYK89xfRqzDajlxnGhoNiN0gxY6vbwUqlEdWfk03OElqKf/ X-Received: by 10.220.68.140 with SMTP id v12mr27910573vci.13.1405508708359; Wed, 16 Jul 2014 04:05:08 -0700 (PDT) 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> In-Reply-To: <53C652FA.6010704@gmail.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQJuUFVOlGiX172RfpkkW7aXwqSXwwLGIEDMAn0sGnoDLh5SUQGHGGlvAc6JkJwCOz0MXAIckqSUAcstGVQBlZLKHwF5/8irAazNhfyZr/bjQA== Date: Wed, 16 Jul 2014 14:05:07 +0300 Message-ID: To: Rowan Collins Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: RE: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: zeev@zend.com (Zeev Suraski) > -----Original Message----- > From: Rowan Collins [mailto:rowan.collins@gmail.com] > Sent: Wednesday, July 16, 2014 1:25 PM > To: internals@lists.php.net > Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) > > Zeev Suraski wrote (on 16/07/2014): > > For me the introduction of a new set of rules is a deal breaker. > > I'm -1 on the RFC the way it is, and +1 if we implement these 'hints' > > as implicit casts, plus change implicit casts to emit E_CAST in case > > of loss of data or 'bogus' conversions. > > Just to be clear, implementing E_CAST would require introducing a set of > rules > for when to throw it. By a strict reading of your message, that's a deal > breaker. Well, not really. First, like all strict notices, they'd be off by default, so standard behavior won't change at all from now, and 'type hints' behavior will be identical to that, so again, nothing new to learn other than the new syntax. Secondly, if you do enable E_CAST - you may have to slightly *modify* your understanding of implicit casts, but you won't have to learn two different sets of rules. New users will see just one consistent set. Zeev