Granted, but the point remains...

try {
... do something risky ...
} catch {
... error recovery code here ...
}
... cleanup code ...

I know the 'finally' debate has come up a couple times in the php-dev ml though.


I think that a good rule of thumb is to end your catch blocks with a simple catch(Exception $e) in order to be sure to catch all of them, even if all you are doing is rethrowing them, IMHO

 
On 10/10/06, Peter Hodge <[EMAIL PROTECTED]> wrote:
--- Bill Karwin <[EMAIL PROTECTED]> wrote:

> That's great, I was thinking of writing a section in the coding
> standards for exceptions too.  I've appended some more notes after
> yours, under a subheading "Exception best practices".

  "Clean up resources such as database connections or network connections. Use
a finally block for this."

PHP has no 'finally' support.

regards,
Peter



____________________________________________________
On Yahoo!7
Music: Create your own personalised radio station.
http://au.launch.yahoo.com/




Reply via email to