Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34371 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73345 invoked by uid 1010); 3 Jan 2008 23:23:27 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 73330 invoked from network); 3 Jan 2008 23:23:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jan 2008 23:23:27 -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:27187] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/13-20810-E6E6D774 for ; Thu, 03 Jan 2008 18:23:27 -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 01:23:23 +0200 Received: from [192.168.16.90] ([192.168.16.90]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 3 Jan 2008 15:23:19 -0800 Message-ID: <477D6E68.5090501@zend.com> Date: Thu, 03 Jan 2008 15:23:20 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: =?UTF-8?B?UGF3ZcWCIFN0cmFkb21za2k=?= CC: internals@lists.php.net References: <200801031903.01980.tomi@cumulo.fi> <477D66B4.2000107@zend.com> <200801040008.43944.pstradomski@gmail.com> In-Reply-To: <200801040008.43944.pstradomski@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 03 Jan 2008 23:23:19.0988 (UTC) FILETIME=[A064CF40:01C84E5F] Subject: Re: [PHP-DEV] RE: Optional scalar type hinting From: stas@zend.com (Stanislav Malyshev) > This code is just a good argument *FOR* type hints. When foo is: > function foo(int $bar) {...} > and you want the code to die if $bar is not integer, then foo($bar) would be Why would you want it? I wouldn't want my code to die, I would want it to work. > you have either an int or string representing an integer in $bar, then > foo((integer)$bar) would work just well. And then how exactly strict typing helps you? You can not control at development time if everybody uses (integer) or not, since being interpreted PHP has no static type checking. So only option to find it out is to leave a minefield behind hoping that testers and not actual users would be ones who make it blow up. What if testers fail to find it? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com