我有方法,在这个方法中可能会发生致命错误,为了捕捉这个错误我做了这个
class a {
function shutDownFunction() {
$error = error_get_last();
if ($error['type'] == 1) {
echo "this is fatal error";
}
}
function terribleFunction () {
register_shutdown_function(array($this,'shutdownFunction'));
// here is code, wich may causes fatal error
}
}
好的,这明白了,但我需要从terribleFunction
to传递参数shutDownFunction
。这个怎么做?