How to turn errors in...
How to turn errors in...
Here's how you can turn errors into exceptions in PHP:
function errorHandler($errno, $errstr, $errfile, $errline) {
throw new Exception("Error: $errstr in $errfile on line $errline", $errno);
}
set_error_handler()
:set_error_handler('errorHandler');
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
ErrorException
class to throw exceptions for specific error level...senior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào