Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77171 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41328 invoked from network); 14 Sep 2014 06:32:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Sep 2014 06:32:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.139 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.139 smtp139.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.139] ([67.192.241.139:54891] helo=smtp139.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/00-39222-79635145 for ; Sun, 14 Sep 2014 02:32:58 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp22.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id D010B2800A4; Sun, 14 Sep 2014 02:32:51 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp22.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 706E928009E; Sun, 14 Sep 2014 02:32:51 -0400 (EDT) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local (c-73-53-124-150.hsd1.wa.comcast.net [73.53.124.150]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.2.10); Sun, 14 Sep 2014 06:32:51 GMT Message-ID: <54153692.7050500@sugarcrm.com> Date: Sat, 13 Sep 2014 23:32:50 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Andrea Faulds CC: "internals@lists.php.net" References: <6893A97A-EC4C-4124-B804-96E2A26B953F@ajf.me> <20140914000718.GB14312@phcomp.co.uk> <3177B936-50C1-4E5D-8687-FD235C72B411@ajf.me> In-Reply-To: <3177B936-50C1-4E5D-8687-FD235C72B411@ajf.me> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [VOTE][RFC] Scalar Type Hinting with Cast From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > oa-res-27-90:php-src ajf$ sapi/cli/php -r 'function foobar(int $a) { > var_dump($a); } foobar(1.5);' > > Catchable fatal error: Argument 1 passed to foobar() must be of the > type int, float given, called in Command line code on line 1 and > defined in Command line code on line 1 Calling this "scalar type hinting with cast" when it doesn't actually cast in wide variety of cases sounds a bit misleading to me. It should be called "scalar type checking with restricted casting" or something like that. I would also ask to clean up an RFC a bit and to clarify which of the proposed choices and "possible changes" are actually being voted for when somebody votes "yes". In any case, I call everybody to vote against this RFC in this form, since it introduces inconsistency between internal and user functions and makes PHP have two different arbitrary sets of rules for implicit conversions, and this can not be good for PHP. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/