Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83448 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26686 invoked from network); 21 Feb 2015 23:31:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Feb 2015 23:31:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.175 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.175 mail-qc0-f175.google.com Received: from [209.85.216.175] ([209.85.216.175:40924] helo=mail-qc0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/5B-08895-73519E45 for ; Sat, 21 Feb 2015 18:31:04 -0500 Received: by qcwb13 with SMTP id b13so6267199qcw.7 for ; Sat, 21 Feb 2015 15:31:01 -0800 (PST) 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; bh=naUU+99Syds86SYe1OzCsLCT+queZf/ZVRXxJaQQjZs=; b=E8AZoYdQj5twkQVTrLMNEQmCmDNR6WTwX+JsF1EbTtPdNJtx1LqyZVoPlhseaAhXAD UzEY/DuniL0kYiVS3udYN6QHwIALkcKf+56ETqG5v4hGFMhbp1QPC8a9HY9xEtlhCSBQ xTZKIzpIm4ctwCWMYEi+Cr0JlLxG0lSS7mEHraeIIs7FA7QO8759lXS+8vSVAT0yJ108 9Ce3h1zPdLC8biULPMbNchpakVyOP40xi4lCSz6ITaPCQKxW/j8OEeT9WLFKddju7Dg/ GnbVZ6AjV/Nf/HVWFJBUezEbGshD5kU8RMN79u8F76NyAu1e8hJjbdOqu2x3L0O9ii2E IrIw== MIME-Version: 1.0 X-Received: by 10.140.102.165 with SMTP id w34mr10020494qge.26.1424561461212; Sat, 21 Feb 2015 15:31:01 -0800 (PST) Received: by 10.96.39.195 with HTTP; Sat, 21 Feb 2015 15:31:00 -0800 (PST) Received: by 10.96.39.195 with HTTP; Sat, 21 Feb 2015 15:31:00 -0800 (PST) In-Reply-To: References: <7ef509ef10bb345c792f9d259c7a3fbb@mail.gmail.com> <8250289916f5128b5bc1a114428d374e@mail.gmail.com> Date: Sat, 21 Feb 2015 15:31:00 -0800 Message-ID: To: Zeev Suraski Cc: Anthony Ferrara , PHP internals Content-Type: multipart/alternative; boundary=001a11c16890db3e07050fa18fa3 Subject: RE: [PHP-DEV] Coercive Scalar Type Hints RFC From: pierre.php@gmail.com (Pierre Joye) --001a11c16890db3e07050fa18fa3 Content-Type: text/plain; charset=UTF-8 On Feb 21, 2015 2:02 PM, "Zeev Suraski" wrote: > > I agree we should have users avoid explicit casts. That's why the > > dual-mode > > proposal exists. If users don't want to control their types, they should > > use the > > default mode. And everything works fine. > > This ignores the reasonable guesstimate - raised by several people here - > that many will flip Strict mode on because they'd think it makes them > inherently safer, faster, or just a good thing to do. Everything I've > learned about PHP in the last couple of decades tells me there are going to > be plenty of those. Those are the same people who would quickly then add > explicit casts to make the code work again; Those are also people who would > benefit a lot more from a single mode system that would point out real > problems in their code, with likely very few false positives or false > negatives. This is not even a remotely comparable to a guess. The users I talk to likes it because they see it as a way to improve their code, not the performance or security but see it as as cleaner, more readable, less error prone, more predictable. Like the drupal case, I would not suggest them to move to strict everywhere, but modules would be free to do so, or part of the core. And that without any impact on the 3rd party users. I repeat, without any impact. --001a11c16890db3e07050fa18fa3--