开发者

custom error handler that would take effect only in my class?

Or do I must call set_error_handler() on beginning开发者_开发知识库 and restore_error_handler() on end of every of my methods ?


Not necessarily.

When your error handler returns false, it will continue to the next registered error handler. (usually the php default error handler).

So you could write your function in a way it only handles specific - custom written - error codes.

function newErrorHandler($errno, $errstr, $errfile, $errline) {
    if (checkIfyours) {
        // Do something.
    }
    return false;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜