title: How can I make set_error_handler() call a method on an object?
body: <p>I think about using the <code>set_error_handler()</code> functionality in PHP to handle most of the PHP errors in one place (logging them to a file). From the documentation it looks like if I can pass a function name to <code>set_error_handler()</code>. Nice! But I have an <code>ErrorManager</code> object which has a nice logging method. I want to use that <code>ErrorManager</code> object and write an special error handler method for it, and have <code>set_error_handler</code> call that <code>ErrorManager</code>. </p>
  
  <p>Could I just do something like?: </p>
  
  <pre><code>set_error_handler($this-&gt;customErrorHandler);
  </code></pre>
  
  <p>Or would that be invalid?</p>