Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49297 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92967 invoked from network); 10 Aug 2010 23:50:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Aug 2010 23:50:39 -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 67.192.241.163 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.163 smtp163.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.163] ([67.192.241.163:32830] helo=smtp163.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BB/11-20356-EC5E16C4 for ; Tue, 10 Aug 2010 19:50:39 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp6.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id B80602702F6; Tue, 10 Aug 2010 19:50:35 -0400 (EDT) X-Virus-Scanned: OK Received: from [10.8.11.37] (unknown [74.85.23.220]) (Authenticated sender: smalyshev@sugarcrm.com) by smtp6.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTPSA id 5F11A27020F; Tue, 10 Aug 2010 19:50:35 -0400 (EDT) Message-ID: <4C61E5CA.5070604@sugarcrm.com> Date: Tue, 10 Aug 2010 16:50:34 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 MIME-Version: 1.0 To: Josh Davis CC: Arvids Godjuks , Internals References: <1281478269.6608.292.camel@guybrush> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Typehints (was Re: [PHP-DEV] Annoucing PHP 5.4 Alpha 1) From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > Derick's point was about consistency. The approach described in his > mail is consistent with current syntax and mechanism(s). Current No it is not. There's no functions that produce errors when fed 1 instead of boolean "true" - all internal functions convert. > typehints do not apply any kind of conversion, so treating scalar > hints the same way is consistent with the current mechanism. Current hints do not apply conversion because conversion does not exist. There can be no conversion between different classes. > Reusing the typecasting syntax for typecasting "hints" makes them more > familiar to the users, and it is less ambiguous than a typehint that > sometimes also typecasts. Plus, it allows for both "strict" That's exactly how internal functions worked in PHP for 10 years - "sometimes" (meaning when the type is wrong) typecast. That's how the rest of the language worked for 10 years in situations like $a = $b+1. How it's "ambiguous" - what are two options that you are confused between and can't choose? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227