Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62641 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86969 invoked from network); 2 Sep 2012 00:37:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2012 00:37:55 -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 67.192.241.113 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.113 smtp113.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.113] ([67.192.241.113:43799] helo=smtp113.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7B/3B-17065-26AA2405 for ; Sat, 01 Sep 2012 20:37:55 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp11.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 7FDEFD062B; Sat, 1 Sep 2012 20:37:51 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp11.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 1905FD062D; Sat, 1 Sep 2012 20:37:51 -0400 (EDT) Message-ID: <5042AA5E.8070307@sugarcrm.com> Date: Sat, 01 Sep 2012 17:37:50 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: Gustavo Lopes CC: Pierre Joye , PHP Internals References: <5040DC47.8000305@ajf.me> <5040F4D9.80206@sugarcrm.com> <5042946A.80204@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Are exceptions allowed in php core? From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > * If users do not expect exceptions in the core, they are mistaken. There > are indeed exceptions in the core. See ZEND_FE_RESET and > zend_interfaces.c. Of course, no evidence has been provided one way or > another. This is not right either, but that was done in 2005. We're now in 2012 and trying to make PHP a bit more orderly. > * In fact, if there is a unifying theme in the usage of exceptions in PHP, > is that exceptions are used when OOP interfaces are involved (see Zend > interfaces, SPL, DateTime and PDO -- though optional there). The core vs. > non-core argument only looks attractive because there are few built-in > classes in the core. That's not my argument. My argument is when you instantiate some class explicitly and work with it, you know you're dealing with certain API that may include exceptions. When you're using foreach(), you don't expect to wrap each foreach() into a try-catch block. But that's what is happening here. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227