Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83868 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31040 invoked from network); 26 Feb 2015 05:02:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Feb 2015 05:02:52 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.178 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.178 mail-qc0-f178.google.com Received: from [209.85.216.178] ([209.85.216.178:33548] helo=mail-qc0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1A/C0-23986-AF8AEE45 for ; Thu, 26 Feb 2015 00:02:51 -0500 Received: by qcxm20 with SMTP id m20so6789231qcx.0 for ; Wed, 25 Feb 2015 21:02:47 -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:content-transfer-encoding; bh=ChhEAE/cupFfzYLN6OkIQ40WpN8hk6eWdP62ZLNG/GE=; b=ZVHoaGhCQ5aMUjClaUIMSSt+fN8FwTtaO4CZi9KnNvFShtzbDLfd9RMjm4aRQWWT/B 7uFdCf7VueW31QgUWD8v/enx6juuctWDtUfPQy4555KsUEeMjfap/SwG3xL9x7/bDFcX Bqlm43wrjrBH8KugFLWk6+n8RQkFmgeibzJRTlhOZqJGuuQImmiS+QnlM4Cvb3kMZ1B6 ykxNMcS78DgfQItXr5oEx8zUp/UbVjIGQyC5H74Rk6ZuBwFS7eI9OZ+yHf3dAQDtJyvT ybWp4MqWz+yzo5h41sC/lfgK3gFinSyC1GM1xRTtbqU+L0VHBAAmj+C6N+uWplujpQsH YL4Q== MIME-Version: 1.0 X-Received: by 10.140.149.130 with SMTP id 124mr14888226qhv.40.1424926967529; Wed, 25 Feb 2015 21:02:47 -0800 (PST) Received: by 10.96.39.195 with HTTP; Wed, 25 Feb 2015 21:02:47 -0800 (PST) In-Reply-To: <09da01d05174$cd7382e0$685a88a0$@php.net> References: <7ef509ef10bb345c792f9d259c7a3fbb@mail.gmail.com> <8250289916f5128b5bc1a114428d374e@mail.gmail.com> <09da01d05174$cd7382e0$685a88a0$@php.net> Date: Wed, 25 Feb 2015 21:02:47 -0800 Message-ID: To: francois@php.net Cc: Zeev Suraski , Anthony Ferrara , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Coercive Scalar Type Hints RFC From: pierre.php@gmail.com (Pierre Joye) On Wed, Feb 25, 2015 at 7:32 PM, Fran=C3=A7ois Laupretre = wrote: > About #1: if, one day, a majority decides that we absolutely need strict = types, it will be very easy. Just define four additional type hints, someth= ing like 'int!', 'float!', 'string!' 'bool!' or any other syntax. These typ= es would be defined as accepting only their native zval type and, of course= , performing no conversion. And that's it. Nothing more. You have your stri= ct types, function by function, argument by argument, return type too if yo= u want. Isn't it nice ? We decided not to propose such types because we thi= nk it would bring more bad than good. That's just an opinion. Do you see th= e difference ? we don't propose strict types for 7.0 but, if you gather a m= ajority favoring it, they may be present in 7.1. I do not think this will even happen, not even in a distant future. > About #2: The risk is not so terrible. As the default is to turn off E_DE= PRECATED messages in production, it is even very low. The highest risk we = take is to see a small performance hit. Probably negligible compared to the= phpng positive impact on performance. As I said earlier, E_DEPRECATED will only caught what it sees, we miss what it does not and actually casts happily. There is no performance hit, let get over that, we have published numbers to show that already. > And temporary because developers will quietly fix their code and the hid= den messages will disappear. So, we probably won't have to rely on 'good lu= ck'. Again. It seems you only see issues with this insignificant E_DEPRECATED messages, it will be just like other or E_NOTICE, they will disable it and move on. However my point is in a totally different area, the one we have no idea what is going on because it is now casted while it was not before. We do not have data to cover these cases. It is not a lack of will but it is simply impossible to have for all apps out there in production (as you said before). And it is exactly why I am against changing the casting rules, even for a single yota beyond what we have done already (or close to this area). > FUD apart, every test Dmitry ran using his upcoming patch (which will imp= lement E_DEPRECATED) on existing PHP software raised very few new errors. M= ore : after analysis, all these messages except 1, I believe, correspond to= undetected bugs in the PHP code. Like the bug I detected in the PHP code t= o build phar.phar. So, I can go further : we are not breaking anything *and= * we are helping users to find undetected bugs in their codebase. Nice sid= e effect, isn't it ? Again, see my previous comment in this mail. Cheers, --=20 Pierre @pierrejoye | http://www.libgd.org