http://docs.php.net/errorfunc.constants diyor ki:
E_RECOVERABLE_ERROR ( integer )
Catchable fatal error. It indicates that a probably dangerous error occured, but did not leave the Engine in an unstable state. If the error is not caught by a user defined handle (see also set_error_handler()), the application aborts as it was an E_ERROR.
ayrıca bkz: http://derickrethans.nl/erecoverableerror.html
örneğin
function myErrorHandler($errno, $errstr, $errfile, $errline) {
if ( E_RECOVERABLE_ERROR===$errno ) {
echo "'catched' catchable fatal error\n";
return true;
}
return false;
}
set_error_handler('myErrorHandler');
class ClassA {
public function method_a (ClassB $b) {}
}
class ClassWrong{}
$a = new ClassA;
$a->method_a(new ClassWrong);
echo 'done.';
baskılar
'catched' catchable fatal error
done.
edit: Ama siz "yapabilir" Eğer bir try-catch bloğu ile işleyebilir bir istisna
function myErrorHandler($errno, $errstr, $errfile, $errline) {
if ( E_RECOVERABLE_ERROR===$errno ) {
echo "'catched' catchable fatal error\n";
throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
// return true;
}
return false;
}
set_error_handler('myErrorHandler');
class ClassA {
public function method_a (ClassB $b) {}
}
class ClassWrong{}
try{
$a = new ClassA;
$a->method_a(new ClassWrong);
}
catch(Exception $ex) {
echo "catched\n";
}
echo 'done.';
bkz: http://docs.php.net/ErrorException