Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61702 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54867 invoked from network); 24 Jul 2012 17:31:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jul 2012 17:31:40 -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.123 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.123 smtp123.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.123] ([67.192.241.123:54523] helo=smtp123.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/82-42538-AFBDE005 for ; Tue, 24 Jul 2012 13:31:39 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp12.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id E02503C001D; Tue, 24 Jul 2012 13:31:35 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp12.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 3F67D3C013D; Tue, 24 Jul 2012 13:31:35 -0400 (EDT) Message-ID: <500EDBF5.1030805@sugarcrm.com> Date: Tue, 24 Jul 2012 10:31:33 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Nikita Popov CC: Laruence , PHP Internals References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > In particular this means that... > ... if a die() is execute somewhere in the try clause (or a called > function) the finally clause must still be run. > ... if a parse error or other fatal error occurs in the try clause (or > called function) the finally clause must still be run. > ... if the user interrupts the process the finally clause must still be run. No I don't think so. finally clause is used to clean up resources allocated/initialized by the code inside try clause. All the above functions will terminate the script and thus all the resources that were allocated will be freed. If you so something more persistent, then a) use shutdown functions b) know that the script can be killed at any moment anyway, so PHP can not guarantee you anything. I don't see how finally ever implied it would be called on die(). > Basically this requires that all of the actions that are currently > fatal need to be converted to exceptions. E.g. Python has special > SystemExit and KeyboardInterrupt exceptions, as well as SyntaxError > and so on. So basically this requires that PHP will be converted to Python. ;) I'd almost write an RFC but then I remembered somebody already wrote Python! :) -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227