Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84808 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45106 invoked from network); 15 Mar 2015 08:42:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Mar 2015 08:42:34 -0000 Authentication-Results: pb1.pair.com header.from=pajousek@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pajousek@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.174 as permitted sender) X-PHP-List-Original-Sender: pajousek@gmail.com X-Host-Fingerprint: 209.85.216.174 mail-qc0-f174.google.com Received: from [209.85.216.174] ([209.85.216.174:36525] helo=mail-qc0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/42-29489-9F545055 for ; Sun, 15 Mar 2015 03:42:33 -0500 Received: by qcto4 with SMTP id o4so21274258qct.3 for ; Sun, 15 Mar 2015 01:42:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=CD/cmrE3fkcLycWqD/p36aBpj3sSB7c+mvEg4WFIfSk=; b=JcdVXnOo0NrY7DdYPbcxKM08AZaOH4vLbvUqXs7J5DWGN6usimemsjf1fCskwA+DEU GXn7EkSuVTUhHP5XNGzLzJPgQpCl5l1Zz9O9i7fLYJOBtM5+aTGajtgO/ow3RvXWS6Ob bremrsHJfqMTBXu8r8/WwfoSf49gulg6uU9MCBUrWrUn1vdXk31TMXxy1ep1mcPYnn9o yI0gLibsyHEEIMbssdLLxvJjrL0mRXIKroB+snjMjO72bm5dpk0a/KoGum0EcaGRrE5B OldYzTpBtPm5b/hgCbKUBaElhEMoliQKMbxDIVRB4JC2FXwNIvb6V6wXqgv7K/M0g+Sa orrQ== MIME-Version: 1.0 X-Received: by 10.140.23.134 with SMTP id 6mr67583922qgp.84.1426408949876; Sun, 15 Mar 2015 01:42:29 -0700 (PDT) Received: by 10.96.160.99 with HTTP; Sun, 15 Mar 2015 01:42:29 -0700 (PDT) In-Reply-To: References: Date: Sun, 15 Mar 2015 09:42:29 +0100 Message-ID: To: Scott Arciszewski Cc: "inter >> PHP internals" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: A plea for unity on scalar types From: pajousek@gmail.com (=?UTF-8?Q?Pavel_Kou=C5=99il?=) On Fri, Mar 13, 2015 at 8:51 PM, Scott Arciszewski w= rote: > Pavel_Kou=C5=99il wrote: > >> - It is a "setting" that changes the language's behavior; I don't >> think that it matters whether or not it would be an INI setting or the >> declare() one, because both of them are bad. >> >> It allows people who want strict typing to declare it on a per-PHP-file > basis. An INI setting cannot offer this guarantee. This is required if we= ak > and strict are to be both supported. > >> - It does not "unite different usages of PHP into a single group"; it >> does exactly the opposite, splitting PHP usage into TWO groups. >> >> It also allows the two groups to work together rather than forking PHP > into separate languages: PHPstrict and PHPweak. > >> - Once this dual mode would be introduced to PHP, there would probably >> be no way of removing it later without massive BC break, once most >> people would realize that it is really awful to have it in the >> language. >> >> What is "really awful" about this? Moving forward, everything could move > towards strict typing. I could see PHP 8 or 9 having strict be the defaul= t, > if everyone wanted that. And then the declare() being deprecated and > removed as major versions increase. > > Scott Hello, I'm sorry, I totally overlooked your email, so I'm replying with a little d= elay. Sure, per-file is better than ini setting, but better doesn't mean good (because it is still a pretty bad approach). The ini setting at least has the option to be turned off in code once everyone realizes it was a bad idea (register_globals via htaccess, for instance), but PHP would be stuck with the declare for a long time - this is not an easily revertable change, once PHP ships with it. The two groups (people who want strong typing and weak typing) will not work *together* though. And it will be a nightmare for everyone working on multiple projects from mulitple clients or so. PHP will IMHO never be strongly-typed by default. It would break BC so much it's not just possible. The best approach to have some reasonable type rules is to progressively "strenghten" the rules (as Zeev's RFC tried to do so, but he probably did two steps in one RFC and that's what people dislike about it?). I think that PHP's type system would get to some "equilibrium" by this - people wanting stronger typing would tried to introduce it and people wanting weaker one would balance it and eventually there could be a point on which both sides could agree on. I sincerely hope the Dual Mode RFC doesn't pass. I can't imagine the RFC being good for the userland developers in the long run. Regards Pavel Kouril