Re: Continued try blocks

From: Date: Sat, 27 Apr 2013 12:16:07 +0000
Subject: Re: Continued try blocks
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
> As Julien said, there is a BC break, when a try/catch block is written
> inside a loop. But I think it's not a major usage, and it's a minor
> inconvenient.

Yeah, and catching and discarding exceptions also possible, albeit a minor
inconvinience.
I don't have a strong opinion on this feature(albeit I think it isn't a
coincidence that most languages doesn't offer a dedicated solution to this
problem) but 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.


Thread (33 messages)

« previous php.internals (#67178) next »