당신은 당신의 자신의 오류 처리기를 만들려고 수 :
이
# temporary error handler
function tempErrorHandler($errNo, $errStr, $errFile, $errLine, array $errContext) {
# continue to practice @ suppression
if (0 === error_reporting()) {
return false;
}
# throw it
throw new ErrorException($errStr, 0, $errNo, $errFile, $errLine);
}
# make this the error handler for now..
set_error_handler('tempErrorHandler');
# use a try..catch
try {
mkdir('../directory with some permission problem../../');
}
catch (ErrorException $e) {
# echo it out
echo $e->getMessage();
# or do whatever you want with it: this part is just an EXAMPLE
$errMsg = $e->getMessage();
$isPermissionDenied = strpos($errMsg, 'Permission denied');
if ($isPermissionDenied) {
# do something
}
}
# revert to previous error handler
restore_error_handler();
코멘트를주의하십시오 # or do whatever you want with it: this part is just an EXAMPLE
그냥 놀러 수 있도록, 버전 5.1.6
에서 무엇을 얻을 오류 --I'm 확실하지 그것 ..
완벽한 솔루션입니다. – Fuzzy