PhpStorm 2019.3 Help

Code Inspection: Inconsistent return points

Reports inconsistencies in function/method exit points.

The following types of inconsistencies are reported:

Reports inconsistencies in function/method exit points.

Technically these are not errors, but practically they usually indicate a programming mistake.

In the following example, the inconsistentReturnPoints function's behavior is inconsistent: it will either return 1 or will not return anything.

function inconsistentReturnPoints() { if ($a) { return 1; } else { $a = 'Foo'; echo $a; } }
Last modified: 20 February 2020