Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83472 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98529 invoked from network); 22 Feb 2015 14:12:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Feb 2015 14:12:02 -0000 Authentication-Results: pb1.pair.com header.from=rich@richgray.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rich@richgray.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain richgray.com from 209.85.212.180 cause and error) X-PHP-List-Original-Sender: rich@richgray.com X-Host-Fingerprint: 209.85.212.180 mail-wi0-f180.google.com Received: from [209.85.212.180] ([209.85.212.180:39525] helo=mail-wi0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/00-32607-FA3E9E45 for ; Sun, 22 Feb 2015 09:12:01 -0500 Received: by mail-wi0-f180.google.com with SMTP id h11so11594997wiw.1 for ; Sun, 22 Feb 2015 06:11:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:reply-to:user-agent :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=h1RS4mMNtMG+D66nN3VLNEOBPEc3M/YuJXyW/COE8EI=; b=dW8wx34lO+ReBnc9KtnGHGaWBPWxWPsVfVVHyui5226F+68zzrbvRUlvwkekJ14ddZ yTLaJG2FRZE54EcRuLRXYoTVg3rmqAk87tot0plMi5VAoVnhqmklw7rdo+zUKZ2QQnc9 krDifVMzS2Sq2pfz9NBoTVxbSYBZcVyZD85ZDhZCUE6BhDqW0LVytlG9lqWuDtv6eNBN iAz6p4V5ArvkoD0QnSdFsG00bkUyiHsQpI1qV5RYBq4UmWxnYwaRIQyLZRT1qVDxRlRB imF4h9MoOByg7aL/1TmB8hoE7vraJjsnbYE5GDBqaGHTPb2G/6/V89nhqd7vlpInfMvc 22tg== X-Gm-Message-State: ALoCoQkFxiRd+LIfx+6daRKOZOjlJL6/bvH94F3bqngl1PsjU9mzf0sW932jNYreDr0lTa/iVyAr X-Received: by 10.180.20.167 with SMTP id o7mr11935106wie.50.1424614316025; Sun, 22 Feb 2015 06:11:56 -0800 (PST) Received: from lemans.home (host86-184-3-149.range86-184.btcentralplus.com. [86.184.3.149]) by mx.google.com with ESMTPSA id l6sm51287355wjx.33.2015.02.22.06.11.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Feb 2015 06:11:55 -0800 (PST) Message-ID: <54E9E3A9.1010305@richgray.com> Date: Sun, 22 Feb 2015 14:11:53 +0000 Reply-To: rich@richgray.com User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Robert Stoll , 'Zeev Suraski' , 'PHP internals' References: <7ef509ef10bb345c792f9d259c7a3fbb@mail.gmail.com> <002101d04ea0$d92ea0f0$8b8be2d0$@tutteli.ch> In-Reply-To: <002101d04ea0$d92ea0f0$8b8be2d0$@tutteli.ch> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: AW: [PHP-DEV] Coercive Scalar Type Hints RFC From: rich@richgray.com (rich gray) On 22/02/2015 13:09, Robert Stoll wrote: [snip] ... > PHP 7.1: necessary bug-fixes introduced with PHP 7.0 > PHP 7.x: deprecate even more if required > PHP 8: > - introduce scalar type hints which reflect the conversion rules as defined (adding strict type hints as well is possible of course, whether with an ini-setting, a declare statement or individually with a modifier something like "strict int" for a single parameter or strict function for all parameters incl. return type or strict class for every type defined in the class is up to discussion) > - exchange the behaviour of (bool), (int) etc. -> use the new conversion rules instead > - change internal functions which do not yet obey to the new conversion rules > - change the operators which do not yet obey to the new conversion rules (for instance, + would also emit an E_RECOVERABLE_ERROR for "a" + 1) > - (change the control structures in order that they obey the new conversion rules as well) => as mentioned above, probably too strict for PHP > > Back to this RFC. think this RFC goes in the right direction with the specified conversion rules. Only thing to get rid of are the implicit conversions to bool from string, float and int IMO. > Moreover, I like that the RFC already has different steps for adding the new behaviour. Yet, I think it should slow down a little bit as shown. I think we need more time to come up with a very good strategic solution. > > Thoughts? > +1 - good analysis - a single mode approach with consistent type coercion rules across the board makes absolute sense even if STH are put back until PHP 8.x