title: Has trigger_error() in PHP been deprecated for something better in PHP5?
body: <p>I used to use this when I wanted to trigger errors in PHP, coming from a PHP4 background. Note I had my own <code>set_error_handler()</code> for handling these errors.</p>
  
  <pre><code>if ($error) {
      trigger_error('Sorry, error has occured');
  }
  </code></pre>
  
  <p>I can't remember where, but sometime ago someone told me I should be 'using exceptions'. As I'm re factoring a lot of my old code, I figured now is the time to get some good advice on my error handling implementation.</p>
  
  <p>Now that I'm using PHP5 (and a bit smarter than I was when I wrote the older code), is my <code>trigger_error()</code> just an old way of doing things, and if so, what is the best way to handle errors in PHP5?</p>