Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.error-handling

Avoid the error suppression operator

The `@` operator hides warnings and errors instead of handling them explicitly.

#Metadata

Rule ID
php.correctness.error-suppression-operator
Severity
medium
Confidence
0.9
Languages
php
Presets
strict
Stability
stable
Applies to
block
Tags
correctness, php, rules-catalog

#Why it matters

Suppressed failures make debugging harder and can mask security or data integrity issues.

#Remediation

Handle expected failures with explicit checks, try/catch where appropriate, or fix the underlying condition instead of silencing errors.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/php/php.correctness.error-suppression-operator.rule.yaml.