Please tell me if this is correct. In my error handler, I should be able to detect when the @ error-control statement was used to suppress errors, because some external libraries (unfortunately) use it a lot. Script execution should continue as if you were not using custom error handlers.
When the at sign is used, PHP temporarily sets error_reporting to 0. Thus, at the beginning of the script, we set error_reporting to any value, but zero - now we can do some beautiful IF / ELSE magic. To avoid errors displayed in the external interface, we also set display_errors to 0, this will override error_reporting (but we can still use this value for magic).
<?php
ini_set('display_errors',0);
error_reporting(E_ALL);
function error_handler($errno, $errstr, $errfile, $errline)
{
if (error_reporting()===0) return;
else die();
}
set_error_handler('error_handler');
@file();
echo 'Execution continued, hooray.';
?>
, ? , .. ( ?)