Run Rector on your code to see what it can do for you:
<div> - <?php for ($i = 5; $i <= count($items); $i++) : ?> + +$counter = count($items);<?php for ($i = 5; $i <= $counter; $i++) : ?> <p>Item <?php echo $i; ?></p> <?php endfor; ?> -</div> +</div>
Applied Rules:
Not a change you expect?
rector.php