Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48419 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7489 invoked from network); 24 May 2010 05:58:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2010 05:58:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 74.85.23.205 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 74.85.23.205 mail.sugarcrm.net Windows 2000 SP2+, XP SP1 (seldom 98 4.10.2222) Received: from [74.85.23.205] ([74.85.23.205:41764] helo=mail.sugarcrm.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/92-21629-8951AFB4 for ; Mon, 24 May 2010 01:58:48 -0400 Received: from StasMacBook.local (98.210.181.235) by exch-cupertino1.cup1.sugarcrm.net (10.8.1.103) with Microsoft SMTP Server (TLS) id 8.1.393.1; Sun, 23 May 2010 22:58:45 -0700 Message-ID: <4BFA1594.3060203@sugarcrm.com> Date: Sun, 23 May 2010 22:58:44 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: References: <7.0.1.0.2.20100522175819.0a601c68@zend.com> <93EFAEF4-26F3-44A1-85ED-5E71E665B966@pooteeweet.org> <698DE66518E7CA45812BD18E807866CE0427ED12@us-ex1.zend.net> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Type hinting From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! >> any mistmatch results in an error > > An error that is recoverable. So not only is the "strict typing" > optional, but "type mismatches" can be caught and handled. Unfortunately, PHP doesn't have good means to handle such kind of errors. Global "shut up" handler is not a good means, as it disables the whole protection, effectively forcing third-party code to work with variable it wasn't written to handle, and you have no means of separating OK and not OK cases. And on top of that, even silent errors are still very expensive in PHP. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227