Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84825 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85522 invoked from network); 15 Mar 2015 14:10:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Mar 2015 14:10:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=leverton@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=leverton@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.52 as permitted sender) X-PHP-List-Original-Sender: leverton@gmail.com X-Host-Fingerprint: 209.85.220.52 mail-pa0-f52.google.com Received: from [209.85.220.52] ([209.85.220.52:33198] helo=mail-pa0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/19-29489-BE295055 for ; Sun, 15 Mar 2015 09:10:52 -0500 Received: by pagr17 with SMTP id r17so37605907pag.0 for ; Sun, 15 Mar 2015 07:10:48 -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=rCZWo26+zNPGxw2pBusp8Ei+GDbcXdiCaQklBrB+g6o=; b=wrwSHpWcaWtM+7NDotf/20D9+l84Q7zFRjd4ZEoeWVIMux4dcbwjRkEBDC5hPUNUYH oPEYNp+1ypqfYnaIphMkKFE0KVPPtHVQjcQN5lZBsHIJH03W8TqZq8xp3A8EY2P21JC8 aRqHe+P1Mx0b/3MroG76OhUbq96tx/YlmSQxsIunnKPfxscFJEntX2u9NykYWZafLX/P qjdyrRl6l5cw9Yrh/z8TMvhIF97pFChdhixfDx+L1IrwYdIhoS8WU2FC+GInAKEnYr27 VuX1YQ5vj7FKFgb4eZRUwxC4iLc3zFiHCXHgpvxRfioWjf1faQD1PTdrgG1LSXb+g8xI /Hvg== MIME-Version: 1.0 X-Received: by 10.70.22.163 with SMTP id e3mr28184082pdf.121.1426428648539; Sun, 15 Mar 2015 07:10:48 -0700 (PDT) Received: by 10.70.65.130 with HTTP; Sun, 15 Mar 2015 07:10:48 -0700 (PDT) In-Reply-To: References: Date: Sun, 15 Mar 2015 09:10:48 -0500 Message-ID: To: =?UTF-8?Q?Pavel_Kou=C5=99il?= Cc: Leigh , Scott Arciszewski , "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: leverton@gmail.com (Matthew Leverton) On Sun, Mar 15, 2015 at 4:52 AM, Pavel Kou=C5=99il wro= te: > So - are you saying that it would be easy to remove this feature from > the language once people would realize it's register_globals (and any > other settings that change how code behaves) all over again? > Actually, it would be very easy to remove this from the language. There is no possible way to rely on strict hints over auto-cast hints in such a way that would break your application by any meaningful definition of the word. Output, after strict_types has been removed from language: E_NOTICE: strict_types is no longer supported. 2 Yes, that would have previously thrown an exception, but the behavior after removing strict types from the language really hasn't broken anything. This is nothing like removing register_globals... where entire apps silently break without any good way to track down how and where. Honestly, I think the reverse of your scenario is more likely. 1) Only the "strict_types=3D0" mode is implemented, using same rules as standard PHP casts. (basic_scalar_types) 2) xdebug adds a feature to enable the equivalent of strict_types=3D1 for debug mode. 3) People realize this is super useful and request "please allow a whitelist while debugging so I can debug my app in pieces" and ask "how can we optionally enable this during production mode?" 4) declare(strict_types=3D1) is proposed for support in PHP without xdebug, and is accepted. :) Finally, the voting process on these two RFCs is absurd, and even more absurd with the proposal of a third one. Very few people are going to play fair and vote YES on multiple of them, even if they would vote YES if it was the only proposal. As I've said before, the best way to reach consensus on *large, grand ideas* (i.e., not petty details) is to hold an instant runoff on a single vote. e.g., Rank your choices in order of preference: scalar_type_hints_v5, coercive_sth, basic_scalar_types, none. First to 2/3's win, after eliminating the least popular vote each round. (Could still end up with a winner < 2/3s, which would just mean the RFC failed.) I sincerely hope this type of vote is added as an option for future RFCs when appropriate, so that we never have to go through this terrible process again. (PS: I have nothing against the RFC authors; on the contrary, I respect all of the work they have put into their proposals. So big thanks to all of you!) -- Matthew Leverton