title: Treating Warnings as Errors
body: <p>I have a php application that I have just re-factored. Unfortunately it spewing out warnings like:</p>
  
  <blockquote>
    <p>Warning: preg_match() expects parameter 2 to be string, object given in /home/yacoby/dev/netbeans/php/Zend/Db/Select.php on line 776</p>
  </blockquote>
  
  <p>Which is impossible (or very hard work) to work out the issue as I don't have a callstack so can't tell which parts of my code are causing the warning and there is a lot of code.</p>
  
  <p>I need a method to either treat warnings like errors (In that the application dies and prints the stacktrace) or I need the stacktrace to be shown when printing errors. Is there a method to do this?</p>