title: How can I get around the lack of a finally block in PHP?
body: <p>PHP prior to version 5.5 has no finally block - i.e., whereas in most sensible languages, you can do:</p>
  
  <pre><code>try {
     //do something
  } catch(Exception ex) {
     //handle an error
  } finally {
     //clean up after yourself
  }
  </code></pre>
  
  <p>PHP has no notion of a finally block.  </p>
  
  <p>Anyone have experience of solutions to this rather irritating hole in the language?</p>