Re: Continued try blocks

From: Date: Fri, 26 Apr 2013 15:47:41 +0000
Subject: Re: Continued try blocks
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-67170@lists.php.net to get a copy of this message
On Friday 26 April 2013 16:41:17 Julien Pauli wrote: > *try {* > * foo();* > * bar();* > * baz();* > *} catch (SomeException $e) {* > * dosomestuff();* > * continue; /* Here is the feature, go back to try block */* > *} catch (Exception $e) {* > * dosomething();* > *}* >... > So, in this example, if, say, bar() throws a SomeException , the code > would then resume and execute baz() after the catch block. What exactly would it "continue" with? The next instruction after whereever the "throw" was? The toplevel function call (or other code) next after the toplevel function in the try block that threw up? The first answer won't work because any object live when bar() threw but only referenced in the call stack below the try block, will already have been destructed. The second answer appears ... semantically dubious. best regards Patrick

« previous php.internals (#67170) next »