Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81847 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25050 invoked from network); 5 Feb 2015 00:02:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2015 00:02:53 -0000 X-Host-Fingerprint: 78.192.130.122 jav75-2-78-192-130-122.fbxo.proxad.net Received: from [78.192.130.122] ([78.192.130.122:22151] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/1F-40930-B23B2D45 for ; Wed, 04 Feb 2015 19:02:52 -0500 Message-ID: <5B.1F.40930.B23B2D45@pb1.pair.com> To: internals@lists.php.net Date: Thu, 05 Feb 2015 01:02:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> In-Reply-To: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Posted-By: 78.192.130.122 Subject: Re: [RFC] Scalar Type Hints v0.2 From: pascal.chevrel@free.fr (Pascal Chevrel) Le 14/01/2015 01:16, Andrea Faulds a écrit : > Good evening, > > I’ve made some quite significant changes to my Scalar T ype Hints RFC, and bumped its version to 0.2. > > Here: https://wiki.php.net/rfc/scalar_type_hints > > This is a new thread because I’ve made a significant revision to the RFC, so it’d be sensible to separate discussion of the updated RFC from the v0.1 RFC. > > Please tell me your thoughts. > > Thanks! Hi Andrea, I am probably going to ask a stupid question, but do we really need the =1 part in declare? declare(strict_types=1) couldn't be declare(strict_types)? Or does it mean that there would be cases when strict typing would be deactivated after being activated with declare(strict_types=0)? To be honest, I don't like declare() because it looks like a function call, not a setting for the file like a namespace declaration would be. Also, in the case of declare(ticks=1), 1 is not a boolean but an interval so I find it a bit confusing that strict_types=1 would be a boolean in that case. Or maybe declare(strict_types=true) then? Personnally I would prefer a syntax like: declare strict; which is just shorter and more readable in my opinion. I know it is mostly cosmetic but I don't really understand why declare uses parenthesis if it is a language construct and not a function (and yes, I think that declare(ticks=1) also looks silly ;) ); So basically instead of that at the top of my files: