PHP prior to version 5.5 has no finally block - i.e., whereas in most sensible languages, you can do:
try { //do something } catch(Exception ex) { //ha
I just finished writing a more elegant Try Catch Finally class which may be of use to you. There are some drawbacks but they can be worked around.
https://gist.github.com/Zeronights/5518445