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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…