File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1413,8 +1413,10 @@ private function processStmtNode(
14131413
14141414 if ($ alwaysIterates ) {
14151415 $ isAlwaysTerminating = count ($ finalScopeResult ->getExitPointsByType (Break_::class)) === 0 ;
1416+ } elseif ($ isIterableAtLeastOnce ->yes ()) {
1417+ $ isAlwaysTerminating = $ finalScopeResult ->isAlwaysTerminating ();
14161418 } else {
1417- $ isAlwaysTerminating = false ; // $finalScopeResult->isAlwaysTerminating() && $isAlwaysIterable
1419+ $ isAlwaysTerminating = false ;
14181420 }
14191421
14201422 return new StatementResult (
Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ public function dataIsAlwaysTerminating(): array
243243 ],
244244 [
245245 'for ($i = 0; $i < 10; $i++) { return; } ' ,
246- false , // will be true with range types
246+ true ,
247247 ],
248248 [
249249 'for ($i = 0; $i < 0; $i++) { return; } ' ,
You can’t perform that action at this time.
0 commit comments