Jump to content

Try, Catch, Finally?


jordanwb

Recommended Posts

I have never used exceptions in PHP, but the finally block should execute whether or not the was an exception thrown or caught.

try{
// code that might throw exception
}catch{
// code will that will run ONLY if exception is thrown
}finally{
// code that will always run
// unless you exit() or die() in the catch, i think
}

 

Link to comment
https://forums.phpfreaks.com/topic/150086-try-catch-finally/#findComment-788235
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.