Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59356 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77874 invoked from network); 5 Apr 2012 22:42:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Apr 2012 22:42:06 -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.133 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.133 smtp133.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.133] ([67.192.241.133:38009] helo=smtp133.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/E7-30259-CBF1E7F4 for ; Thu, 05 Apr 2012 18:42:05 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp13.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 95AF63D07B3 for ; Thu, 5 Apr 2012 18:42:01 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp13.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 5EE7A3D0427 for ; Thu, 5 Apr 2012 18:42:01 -0400 (EDT) Message-ID: <4F7E1FB8.7020108@sugarcrm.com> Date: Thu, 05 Apr 2012 15:42:00 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: "internals@lists.php.net" References: <2FD77C3003DC4656BCF6309B097DD978@gmail.com> In-Reply-To: Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] resume after exception From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! >> it's a wonderful mechanism with more uses than simply reporting errors >> - the aspect of transferring control is what I find really interesting >> about exceptions. Exceptions should not be used for flow control. They are called "exceptions" for a reason - to signify that something unusual (exceptional) happened outside normal application functionality, which now needs to be abandoned and the application should switch into "the sky is falling, how I get out of it without losing too much?" mode. If you're using exceptions for anything that is normal for your application, you're doing it wrong. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227