Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49309 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28327 invoked from network); 11 Aug 2010 04:42:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Aug 2010 04:42:14 -0000 Authentication-Results: pb1.pair.com header.from=robert@interjinn.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=robert@interjinn.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain interjinn.com from 66.11.173.122 cause and error) X-PHP-List-Original-Sender: robert@interjinn.com X-Host-Fingerprint: 66.11.173.122 unknown Received: from [66.11.173.122] ([66.11.173.122:46739] helo=interjinn.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4C/76-20356-10A226C4 for ; Wed, 11 Aug 2010 00:41:39 -0400 Received: by interjinn.com (Postfix, from userid 5001) id 0A1493702CC; Wed, 11 Aug 2010 00:41:33 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gruknuk.suds X-Spam-Level: X-Spam-Status: No, score=-4.4 required=7.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.5 Received: from [192.168.1.3] (blobbie [192.168.1.3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by interjinn.com (Postfix) with ESMTPSA id BF6F53702CB; Wed, 11 Aug 2010 00:41:01 -0400 (EDT) Message-ID: <4C6229DD.1020605@interjinn.com> Date: Wed, 11 Aug 2010 00:41:01 -0400 Organization: InterJinn User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100528 Thunderbird/3.0.5 MIME-Version: 1.0 To: Josh Davis CC: Stas Malyshev , Arvids Godjuks , Internals References: <1281478269.6608.292.camel@guybrush> <4C61E5CA.5070604@sugarcrm.com> <4C61F3EF.5030409@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Strict typing From: robert@interjinn.com (Robert Cummings) On 10-08-11 12:03 AM, Josh Davis wrote: > On 11 August 2010 02:50, Stas Malyshev wrote: >> Hi! >> >>> First of all, I am talking about the typehinting syntax and mechanism >>> here. As Derick pointed out, current typehints are strict. >> >> Talking about "strict" vs. "non-strict" for class types is meaningless. > > By "strict" typehints I meant that no typecasting occurs. Personally > I'm not fan of the "strict" vs "weak" denomination used here either. > I'd rather call them typechecking vs smartcasting. I'd prefer jugglehints... since I'd like PHP to coerce whatever I pass as a parameter to the "hinted" type. This is the PHP way... type juggling to save the developer the hassle. If I set a jugglehint of "int" then I would expect the value to be coerced to an integer regardless of whether 12.0, 12, "12", or "12 brown cows" is passed. The process of type juggling is well documented and has been for years. Why change that? Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized.