jordanwb Posted March 19, 2009 Share Posted March 19, 2009 I know what the try and catch blocks do but what does the finally block do? Quote Link to comment Share on other sites More sharing options...
markjoe Posted March 19, 2009 Share Posted March 19, 2009 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 } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.