Re: Continued try blocks

From: Date: Sat, 27 Apr 2013 13:56:56 +0000
Subject: Re: Continued try blocks
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
2013/4/27 Ferenc Kovacs <[email protected]>

> please don't reuse the continue keyword for it.
>
> There are a bunch of code out there where which uses exceptions in a loop
> context.
> For example you have a retry counter decremented in a loop and you catch
> the exceptions and retry until the retry limit is reached.
>
Fair enough. We can use "resume".

 try {
     doThis();
     doThat();
 } catch (NotImportantException $nie) {
     addToLog($nie->getMessage());
     resume;
 } catch (Exception $e) {
     cleanupEverything();
 }


Thread (33 messages)

« previous php.internals (#67181) next »