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.
Could I just do something like?:
set_error_handler($this->customErrorHandler);
Or would that be invalid?
Pass in an array of the object and the method name to be called:
set_error_handler()takes a callback:(emphasis added)