Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83429 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93529 invoked from network); 21 Feb 2015 21:18:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Feb 2015 21:18:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=markus@fischer.name; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=markus@fischer.name; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fischer.name from 62.179.121.49 cause and error) X-PHP-List-Original-Sender: markus@fischer.name X-Host-Fingerprint: 62.179.121.49 fep31.mx.upcmail.net Solaris 10 (beta) Received: from [62.179.121.49] ([62.179.121.49:37551] helo=fep31.mx.upcmail.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/D4-08895-016F8E45 for ; Sat, 21 Feb 2015 16:18:09 -0500 Received: from edge02.upcmail.net ([192.168.13.237]) by viefep31-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20150221211805.BAFH3302.viefep31-int.chello.at@edge02.upcmail.net> for ; Sat, 21 Feb 2015 22:18:05 +0100 Received: from mail02.home ([213.47.1.174]) by edge02.upcmail.net with edge id v9J51p00E3lFLNl019J54Y; Sat, 21 Feb 2015 22:18:05 +0100 X-SourceIP: 213.47.1.174 Received: from mail02.home ([192.168.1.14] helo=[IPv6:::1]) by mail02.home with esmtp (Exim 4.72) (envelope-from ) id 1YPHR5-0001rb-PK for internals@lists.php.net; Sat, 21 Feb 2015 22:18:05 +0100 Message-ID: <54E8F60B.2070000@fischer.name> Date: Sat, 21 Feb 2015 22:18:03 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net References: <7ef509ef10bb345c792f9d259c7a3fbb@mail.gmail.com> In-Reply-To: <7ef509ef10bb345c792f9d259c7a3fbb@mail.gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam_report: Spam detection software, running on the system "scanner01.home", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Zeev, On 21.02.15 18:22, Zeev Suraski wrote: > I’ve been working with François and several other people from internals@ > and the PHP community to create a single-mode Scalar Type Hints proposal. > > I think it’s the RFC is a bit premature and could benefit from a bit more > time, but given the time pressure, as well as the fact that a not fully > compatible subset of that RFC was published and has people already > discussing it, it made the most sense to publish it sooner rather than > later. > > http://wiki.php.net/rfc/coercive_sth [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: Re: [PHP-DEV] Coercive Scalar Type Hints RFC From: markus@fischer.name (Markus Fischer) Hi Zeev, On 21.02.15 18:22, Zeev Suraski wrote: > I’ve been working with François and several other people from internals@ > and the PHP community to create a single-mode Scalar Type Hints proposal. > > I think it’s the RFC is a bit premature and could benefit from a bit more > time, but given the time pressure, as well as the fact that a not fully > compatible subset of that RFC was published and has people already > discussing it, it made the most sense to publish it sooner rather than > later. > > http://wiki.php.net/rfc/coercive_sth Thanks for the refreshed approach. Although there are already oh-so-many RFCs and discussion, I found the sum up to be very clear. Thanks to you at al. 1) About impact / BC There's one thing I never understood, even not for 0.3 which almost went through: why have this impact on internal function/zend_parse_parameters/ZPP at all? Why not just keep this strictly user-land /for now/ ? The user-land change is much more controllable. The internal function change is ... not sure how to say. Has such a big impact and I'm not sure what should be the gain at all here. 2) I'm with Pierre regarding accepting e.g. 42.0 for an int. Just imagine you pass the result of a calculation which happens to be a result with a clean .0 fractional part and everything works. The next time you calculate with a different input and *boom* your value is 42.1 and thus reject. That's quite a POLA [1] right there. I know I will derail this whole thing when I write the next point but I really think one of the best ways to move forward is to - only support strict types, e.g. function foo(string $bar) - in user-land code That way the there's almost no BC impact sans the possible clashes of classnames (which I probably just missed how this will be resolved?). Future RFCs could still reason about other typo of hints (initial weak STH or now this coercive STH) and expand on the syntax. thanks, - Markus [1] http://en.wikipedia.org/wiki/Principle_of_least_astonishment