Phpinspectionsea: [false-positive] `for` loop is marked as error when iteration expression is `*=`

Created on 3 Apr 2018  路  2Comments  路  Source: kalessil/phpinspectionsea

In the following code the line with for statement is marked with Suspicious loop inspection

<?php

for ($i = 1; $i <= 10; $i *= 2) {}

If the iteration expression is changed to $i++ the inspection goes away.

I probably am missing something, but I don't see how $i *= 2 is more "suspicious" than $i++.

bug / false-positive fixed

All 2 comments

Thank you for reporting @zerkms. That's false-positive, I'll take care of it.

Fixed

Was this page helpful?
0 / 5 - 0 ratings