@)In plain English: The @ symbol in PHP suppresses errors and warnings from being reported. This rule flags and forbids its use.
Why it matters: Using @ hides underlying problems (such as failed file reads, undefined indexes, or connection errors). Instead of fixing the root cause or handling exceptions/conditionals properly, error suppression sweeps bugs under the rug, making debugging extremely difficult when things fail silently in production.
// Suppressing errors when reading a file or calling a risky function
$content = @file_get_contents($filename);
@$this->connectDatabase();
// Handle errors explicitly using conditionals, try/catch, or validation
if (file_exists($filename)) {
$content = file_get_contents($filename);
} else {
throw new FileNotFoundException("File not found: $filename");
}
try {
$this->connectDatabase();
} catch (DatabaseException $e) {
Log::error("Database connection failed: " . $e->getMessage());
}
@).@ operator is used.@ operator.file_exists(), isset()) or try...catch blocks to handle potential failures robustly.E0011 has no configuration options and is enabled by default.
Never use the @ error suppression operator. If an operation can fail, check for failure or catch the exception explicitly!