Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.control-flow

Remove unreachable statements after return or throw

Code after `return` or `throw` in the same block never runs.

#Metadata

Rule ID
php.correctness.unreachable-after-return
Severity
low
Confidence
0.85
Languages
php
Presets
strict
Stability
stable
Applies to
block
Tags
correctness, php, rules-catalog

#Why it matters

Unreachable statements usually indicate dead code, incomplete refactors, or missing control-flow fixes.

#Remediation

Delete the dead code or move it before the terminal statement if it is still required.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/php/php.correctness.unreachable-after-return.rule.yaml.