How can I make set_error_handler() call a method on an object?
<p>I think about using the set_error_handler() 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 set_error_handler(). Nice! But I have an ErrorManager object which has a nice logging method. I want to use that ErrorManager object and write an special error handler method for it, and have set_error_handler call that ErrorManager. </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>
