开发者

Set_error_handler with static-method callback

I RTM but I couldn't find any nice answer to this question, so here is it:


set_error_handler expects a value of the pseudo-type callback. And in the examples there you can see that there are two ways to specify a static method:

set_error_handler(array('Class', 'method'));

// since PHP 5.2.3
set_error_handler('Class::method');


Yes; this syntax works:

set_error_handler('error::function');

As stated in the doc, you just have to pass a valid callback. http://php.net/manual/en/language.pseudo-types.php#language.types.callback(dead link)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜