Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58719 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40460 invoked from network); 7 Mar 2012 07:31:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Mar 2012 07:31:13 -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 207.97.245.143 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 207.97.245.143 smtp143.iad.emailsrvr.com Linux 2.6 Received: from [207.97.245.143] ([207.97.245.143:55015] helo=smtp143.iad.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 21/40-38795-FBE075F4 for ; Wed, 07 Mar 2012 02:31:11 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp24.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 4AACE1A0847 for ; Wed, 7 Mar 2012 02:31:08 -0500 (EST) X-Virus-Scanned: OK Received: by smtp24.relay.iad1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 030DB1A07C3 for ; Wed, 7 Mar 2012 02:31:07 -0500 (EST) Message-ID: <4F570EBB.6030103@sugarcrm.com> Date: Tue, 06 Mar 2012 23:31:07 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.1) Gecko/20120208 Thunderbird/10.0.1 MIME-Version: 1.0 To: "internals@lists.php.net" References: <52.38.15021.3A1E65F4@pb1.pair.com> In-Reply-To: <52.38.15021.3A1E65F4@pb1.pair.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Scalar Type Hinting From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! >>> https://wiki.php.net/rfc/parameter_type_casting_hints Just took a look on it - the syntax proposed there is quite ugly and rather confusing, I really wouldn't like to have such syntax in PHP. Also "(int) $foo = “1” will generate an E_COMPILE_ERROR" makes no sense to me. Also, this line: function test((int) $intParam, (string) $strParam = "foo", (array) $array) {} is not proper PHP code - it contains optional parameter and then parameter with no default. And can we please stop using word "hinting"? We can call it type conversion, typecasting, type coercion, etc. http://en.wikipedia.org/wiki/Type_conversion But I don't see how there's any hinting involved. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227