Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76135 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31934 invoked from network); 25 Jul 2014 19:20:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2014 19:20:31 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.123 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.123 smtp123.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.123] ([108.166.43.123:52319] helo=smtp123.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 26/B9-08559-EFDA2D35 for ; Fri, 25 Jul 2014 15:20:31 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp16.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 0A94738085C; Fri, 25 Jul 2014 15:20:34 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp16.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id AD3C938054A; Fri, 25 Jul 2014 15:20:33 -0400 (EDT) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net [108.66.6.48]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.2.10); Fri, 25 Jul 2014 19:20:33 GMT Message-ID: <53D2AE01.8020806@sugarcrm.com> Date: Fri, 25 Jul 2014 12:20:33 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Andrea Faulds CC: "internals@lists.php.net" References: <20A80B2E-42BB-486F-8F83-A6FDBEBA4056@ajf.me>,<5B708D89-B208-4644-BC89-1B7AE98A99BA@ajf.me> <6A40E21F-D265-4ADC-AD79-4EDB7AB45A01@ajf.me> In-Reply-To: <6A40E21F-D265-4ADC-AD79-4EDB7AB45A01@ajf.me> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > After consulting with Anthony about this, the RFC and patch have been > updated to disallow booleans for int, float, numeric and string type > hints. The conversions table now looks like this: This makes very little sense, 0 means the same as false is in many contexts in PHP and also in many languages. Having random arcane rules would only make the users curse us every time they get tripped by them. I call everybody to vote against this RFC - it's better not to have such thing at all then to promise our users improvement only for them to discover this improvement is fraught with inconsistent arbitrary rules that do not match what the rest of the language is doing - even within the same context of the function call. I can see no uniting principle behind this table, which is randomly strict and randomly non-strict without connection to the rest of PHP. I do not think it is the right thing to have such thing in the language, even if it would help somebody's particular use-case. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/