title: Does a PHP exception stop execution?
body: <pre><code>&lt;?php
       function some_function($arg) {
           if($filter-&gt;check_for_safe_input($arg)) {
               throw new Exception("Hacking Attempt");
           }
           do_some_database_stuff($arg);
       }
   ?&gt;
  </code></pre>
  
  <p>In the above code example, does <code>do_some_database_stuff</code> ever get called if <code>check_for_safe_input</code> fails, or does the exception stop the function running? It's something I've never quite been sure of, and usually I just stick functions like <code>do_some_database_stuff</code> in an else statement to be sure, but this tends to lead to hugely nested functions.</p>