Continued try blocks

From: Date: Fri, 26 Apr 2013 14:41:17 +0000
Subject: Continued try blocks
Groups: php.internals 
Request: Send a blank email to internals+get-67167@lists.php.net to get a copy of this message
Hello internals, I had an idea recently with a friend, about a feature try-catch blocks could use. Let me just write an example, you will quickly understand the idea : *<?php* * * *try {* * foo();* * bar();* * baz();* *} catch (SomeException $e) {* * dosomestuff();* * continue; /* Here is the feature, go back to try block */* *} catch (Exception $e) {* * dosomething();* *}* The continue keyword would resume the execution from where it had diverged, according to the function which led to the SomeException catch block. So, in this example, if, say, bar() throws a SomeException , the code would then resume and execute baz() after the catch block. Just presenting the idea here, no RFC actually , I'm collecting thoughts and notices. Julien.Pauli

« previous php.internals (#67167) next »