Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82919 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11498 invoked from network); 17 Feb 2015 03:30:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2015 03:30:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 66.111.4.28 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 66.111.4.28 out4-smtp.messagingengine.com Received: from [66.111.4.28] ([66.111.4.28:55630] helo=out4-smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 70/E0-05651-6D5B2E45 for ; Mon, 16 Feb 2015 22:30:31 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 20F2020B50 for ; Mon, 16 Feb 2015 22:30:27 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 16 Feb 2015 22:30:27 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:message-id:date:from :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=q0YMUwYmn4KZLNe+Am1DuM 4Kh0w=; b=nBAUtp7dikHAEHawwwHDDFtwcm7Uen1wlyzoOzILzQbEXoeYerKjod 7zzw9XXxTS1CPsMRfUjt+Dq+pTDXB9lEqEpC6eOpdSQd2SwnxaxRffgWcfTmG4JM AOlUM1uBGOttAPJtJYpBjZtwWfp1uQEpfSVF6aQQYXWcEPeN5+0So= X-Sasl-enc: 0KgRToXs2IDDtww0yvXJ7t1EmwNhPoBpYgP+i17bLGox 1424143827 Received: from [192.168.0.21] (unknown [190.158.192.40]) by mail.messagingengine.com (Postfix) with ESMTPA id 18582C0029D for ; Mon, 16 Feb 2015 22:30:26 -0500 (EST) Message-ID: <54E2B5D1.7030008@garfieldtech.com> Date: Mon, 16 Feb 2015 22:30:25 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net References: <011801d04a07$83ab1c00$8b015400$@php.net> <016f01d04a3a$e9183220$bb489660$@php.net> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Reviving scalar type hints From: larry@garfieldtech.com (Larry Garfield) On 02/16/2015 06:58 PM, Sara Golemon wrote: > On Mon, Feb 16, 2015 at 2:50 PM, François Laupretre wrote: >> Once again, anyone can take over version 0.3, if it is so great. Why don't you do it ? >> I will play the game, stop working on my proposal, and vote 'yes' again. >> But don't ask me to do it in your place. >> > If nobody else does it, I will. > > I think Andrea's 0.3 proposal was extremely well balanced, served > everyone's needs whether they would admit it or not, and who's only > failing (subjectively termed) was the use of declare(). I think > declare() is fine and not nearly as ugly as some have slandered it to > be, but I'm willing to read the winds and modify it for v0.4. > > Straw poll: > 1) 2) 3) use strict; (psuedo-namespace) > 3) 4) declare(strict=true); (As a top-level declare only) > 5) declare(strict=true); (exactly as in v0.3 -- maybe you liked it) > 6) your write-in vote here > > I'm not going to scope in union types, nullables, or falsables. We > can leave that for a followup RFC, this one is contentious enough as > it is. > > -Sara As ugly as the declare() syntax is, "strict" means very little. What else qualifies as "strict"? It also seems likely to be confused with E_STRICT, which is something else. So I suppose I'd hold my nose and stick with 4 or 5. That said, I think it was Zeev (or maybe Andi?) that suggested tightening the coercion rules at the same time to reduce the need for strict mode. (Eg, "99 red balloons" silently becoming int 99 is asking for trouble even in weak-mode.) I don't know if it's possible to tidy that up as well at this point, but it's a fair point that the coercion now is sometimes too forgiving. I don't know enough about the internals code to suggest how to address Rasmus' points, but they sound valid from the outside, at least. Not steering people toward "well just throw casts around" is something to keep in mind. --Larry Garfield