Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34368 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66710 invoked by uid 1010); 3 Jan 2008 22:50:37 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 66695 invoked from network); 3 Jan 2008 22:50:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jan 2008 22:50:37 -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:18260] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/F1-20810-BB66D774 for ; Thu, 03 Jan 2008 17:50:36 -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 00:50:32 +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 14:50:28 -0800 Message-ID: <477D66B4.2000107@zend.com> Date: Thu, 03 Jan 2008 14:50:28 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Alexey Zakhlestin CC: Sam Barrow , internals@lists.php.net References: <200801031903.01980.tomi@cumulo.fi> <20080103172813.GQ7861@mint.phcomp.co.uk> <477D2B40.9010302@fischer.name> <477D2CDB.3000005@zend.com> <477D452A.9090906@zend.com> <1199392531.15292.64.camel@sbarrow-desktop> <477D4ACF.3030006@zend.com> <1199395138.15292.72.camel@sbarrow-desktop> <477D58ED.6030101@zend.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 03 Jan 2008 22:50:28.0007 (UTC) FILETIME=[09006370:01C84E5B] Subject: Re: [PHP-DEV] RE: Optional scalar type hinting From: stas@zend.com (Stanislav Malyshev) > type-hinting is asserting. > checking of types is needed only on interface-border points (where With strict checking, that means instead of calling: foo($bar); you'd have now to do: if(is_integer($bar)) { // stupid foo() call would blow up if passed not integer, so I have to manually handle it // oh wait, actually I don't have any way to handle it - I need foo() to be called to proceed // so let's just die("can't call foo() because \$bar is not integer"); } foo($bar); Now how it's easier or makes application more stable? What happens if foo() is changed and now accepts both integers and strings? What happens if someone forgets to write a wrapper? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com