Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34457 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37569 invoked by uid 1010); 4 Jan 2008 19:15:33 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 37550 invoked from network); 4 Jan 2008 19:15:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jan 2008 19:15:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:38044] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/41-63281-7C58E774 for ; Fri, 04 Jan 2008 14:15:26 -0500 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 4 Jan 2008 21:15:11 +0200 Received: from [192.168.16.90] ([192.168.16.90]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 4 Jan 2008 11:15:08 -0800 Message-ID: <477E85BC.60905@zend.com> Date: Fri, 04 Jan 2008 11:15:08 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Sam Barrow CC: Andi Gutmans , internals@lists.php.net References: <200801031903.01980.tomi@cumulo.fi> <698DE66518E7CA45812BD18E807866CE01103E21@us-ex1.zend.net> <1199454404.15292.123.camel@sbarrow-desktop> <698DE66518E7CA45812BD18E807866CE01103EB7@us-ex1.zend.net> <1199472188.15292.175.camel@sbarrow-desktop> In-Reply-To: <1199472188.15292.175.camel@sbarrow-desktop> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Jan 2008 19:15:08.0129 (UTC) FILETIME=[1E913510:01C84F06] Subject: Re: [PHP-DEV] RE: Optional scalar type hinting From: stas@zend.com (Stanislav Malyshev) > I've stated my opinion on this, I'm going for standard hinting. Int > means int, not "1" or "one" or "1one". Bool means boolean true or false, I don't see any difference in substance between 1 and "1". > not "true", 1, 0, "0", etc. Same for boolean - I don't see any substantial difference between (int)0, (float)0 and (boolean)false and see no reason ever to make a function that distinguishes between those. Now, statically-typed compiled languages do it for the very good reason - it is very hard to implement such versatile API manually. It is infeasible to make all C function declared as foo(int i) to take char* instead and use atoi() or whatever it needs to be - and do it for each and every function. That's exactly why scripting languages with loose typing were created - to allow programmers to get rid of these technicalities and work with substance of the values, not with bit representation of them. Now you come back and say - no, my function would accept (boolean)0 but would pretend it can not handle (int)0 because the bits in a type field of the variable are wrong. What could be the practical purpose of such dumbing-down? Getting all the stress of the programming in statically typed language without compile-time checking and safety as a compensation for the stress? Doesn't look as a good deal for me. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com