OTA*_*TAR 5 php oop arguments callable
我有方法,在这个方法中可能会发生致命错误,因为我抓住了这个错误
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
}
}
Run Code Online (Sandbox Code Playgroud)
好了,这个理解,但我需要通过参数terribleFunction来shutDownFunction.怎么做到这个?