I have seen in many Symfony bundles (and also in other codes) this line :
@trigger_error(\'The class is deprecated\', E_USER_DEPRECATED);
Accor
Just speculating, but this could be used to be handled by a custom error handler.
Example:
set_error_handler(function ($err_severity, $err_msg, $err_file, $err_line, array $err_context)
{
//Log the error
// error was suppressed with the @-operator
if (0 === error_reporting()) {
return false;
}
// handle error
}
Therefore the error can be logged (or otherwise handled) even if it is suppressed.
You can't know exactly why this is done unless there's documentation about it. It's up to the developers to explain why they do this.