Inspectopedia Help

Loop does not iterate

Reports the loop statements whose bodies will execute at most once.

The inspection does not report foreach loops with a key or value used inside the loop body. Commonly, such loops are intended to perform an action only on their first iteration (for example, get the first element of an array).

Inspection Details

Available in:

PhpStorm 2023.3, Qodana for PHP 2023.3



Last modified: 13 July 2023