Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_default_classes.c zend_default_classes.h zend_execute.h zend_execute_API.c

From: Date: Fri, 13 Feb 2004 17:45:51 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_default_classes.c zend_default_classes.h zend_execute.h zend_execute_API.c
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-7811@lists.php.net to get a copy of this message
George Schlossnagle wrote:
On Feb 13, 2004, at 11:35 AM, Adam Maccabee Trachtenberg wrote:
Andi's point, I believe, is that otherwise we'll need to add a "finally" keyword to make sure some random extension doesn't throw some random undocumented exception that you could miss. And I agree with him. It just seems to make everything more clean.
'Finally' is used for code that is executed anyway, whether an exception has occurred or not. This is different from 'catch (...)' because the catch clause is not executed if the try block exits with no eceptions. Like try { // open file // do something that throws() } catch (Exception $e) { // do nothing } // close file // re-throw if ($e) throw $e; 'Finally' would be useful, but can be emulated as shown. Personally, I like the compulsory derivation for 'throw' operands, but I would prefer it to be an interface instead of a class. In that case, it is a lot easier to plug your own class (hierarchy) into the exception framework. -- Ard

« previous php.internals (#7811) next »