Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84776 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48334 invoked from network); 14 Mar 2015 13:45:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Mar 2015 13:45:04 -0000 Received: from [127.0.0.1] ([127.0.0.1:22759]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 9C/E2-29409-F5B34055 for ; Sat, 14 Mar 2015 08:45:03 -0500 X-Host-Fingerprint: 94.208.19.102 5ED01366.cm-7-1a.dynamic.ziggo.nl Received: from [94.208.19.102] ([94.208.19.102:18037] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F6/E2-29409-88934055 for ; Sat, 14 Mar 2015 08:37:13 -0500 Message-ID: To: internals@lists.php.net Date: Sat, 14 Mar 2015 14:37:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0 MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 94.208.19.102 Subject: Re: [PHP-DEV] A plea for unity on scalar types From: peter@f-is.nl (Peter van Fessem) On 03/14/2015 01:10 PM, Derick Rethans wrote: > On Fri, 13 Mar 2015, Arvids Godjuks wrote: > >> It's magic_quotes and register_globals all over again, but this time >> you can't fix it with some PHP code. > > It is not even close to equivalent. As those options are php.ini > settings. There is nothing, absolutely *nothing*, that will change if > you, as an author of a PHP file, does not use typehints in that file. > > If a dev turns a file that he or she wrote into strict mode, then that > only counts for that specific file. If you take over some code, then you > can remove the declare line. *none* of those things you'd be able to do > with ini settings. So don't shout out that nonsense FUD. > It's equivalent to an ini setting in that it changes the behavior of the code based on something that is declared elsewhere. Obviously a declare statement in the top of the file is a lot better than an ini setting, but I think the principle is the same. I prefer consistency over choice. I don't think it's that important that it matches my wishes/requirements exactly, because it's never going to; but if a switch is going to be implemented, I'm going to have to use both depending on who I work with/for, and that seems a lot more annoying than whatever the type system ends up being. I would strongly prefer a type system that matches the current type conversion rules, and slowly 'strengthen' these *together*, over the next few major releases to something that matches the weak type system proposals. Somewhat unrelated: I don't really buy the javascript strict mode comparison. Strict mode was added to differentiate between an 'old' and a 'new' system, but here two new modes are added in one go. Just my 2 cents. Regards, Peter