set_error_handler('handleError', error_reporting());
public function handleError($type, $message, $file = '', $line = 0, $context = array()) { if (error_reporting() !== 0) { $error_types = error_reporting(); if ($error_types & $type) { // &按位取与 // do your things }
}
}