Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83866 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24380 invoked from network); 26 Feb 2015 03:32:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Feb 2015 03:32:19 -0000 Authentication-Results: pb1.pair.com header.from=francois@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=francois@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@php.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:32374] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 07/00-23986-1C39EE45 for ; Wed, 25 Feb 2015 22:32:17 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id E5C4C4B017C; Thu, 26 Feb 2015 04:31:55 +0100 (CET) Reply-To: To: "'Pierre Joye'" , "'Zeev Suraski'" Cc: "'Anthony Ferrara'" , "'PHP internals'" References: <7ef509ef10bb345c792f9d259c7a3fbb@mail.gmail.com> <8250289916f5128b5bc1a114428d374e@mail.gmail.com> In-Reply-To: Date: Thu, 26 Feb 2015 04:32:09 +0100 Message-ID: <09da01d05174$cd7382e0$685a88a0$@php.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQKcPg+jpyYspJS11b5G1A7RBHpKTgFW66vOANg4ZZIBOJUt6QIcwpl/AeIBZpMDDZr3vwHYWlMZmwf7N5A= Content-Language: fr X-Antivirus: avast! (VPS 150225-3, 25/02/2015), Outbound message X-Antivirus-Status: Clean Subject: RE: [PHP-DEV] Coercive Scalar Type Hints RFC From: francois@php.net (=?utf-8?Q?Fran=C3=A7ois_Laupretre?=) Hi Pierre, > De : Pierre Joye [mailto:pierre.php@gmail.com] >=20 > With the other RFC, which changes the casting modes, I wish everyone > good luck. I may be wrong, can happen ;), but we simply do not know > and will not know before 7.0.0 is out. Good luck to change them again > to "adapt and tweak", and good luck to the apps developers to adapt > their apps with plenty of patch versions checks. This is the reason #2 > why I am against your RFC, the #1 being the total lack of actual non > magic casting (read: strict), optionally enabled. 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, = something like 'int!', 'float!', 'string!' 'bool!' or any other syntax. = These types 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 strict types, function by function, argument by argument, = return type too if you want. Isn't it nice ? We decided not to propose = such types because we think it would bring more bad than good. That's = just an opinion. Do you see the difference ? we don't propose strict = types for 7.0 but, if you gather a majority favoring it, they may be = present in 7.1. About #2: The risk is not so terrible. As the default is to turn off = E_DEPRECATED 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. And temporary = because developers will quietly fix their code and the hidden messages = will disappear. So, we probably won't have to rely on 'good luck'. FUD apart, every test Dmitry ran using his upcoming patch (which will = implement E_DEPRECATED) on existing PHP software raised very few new = errors. More : 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 to 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 side effect, isn't it ? Regards Fran=C3=A7ois