Skip to content

Commit

Permalink
cover division by false-values
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Feb 1, 2022
1 parent 2c0306e commit 578e96d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/PHPStan/Analyser/data/div-by-zero.php
Expand Up @@ -17,7 +17,12 @@ public function doFoo(int $range1, int $range2, int $int): void
assertType('(float|int)', 5 / $range2);
assertType('(float|int)', $range1 / $range2);
assertType('(float|int)', 5 / $int);

assertType('*ERROR*', 5 / 0);
assertType('*ERROR*', 5 / '0');
assertType('*ERROR*', 5 / 0.0);
assertType('*ERROR*', 5 / false);
assertType('*ERROR*', 5 / null);
}

}

0 comments on commit 578e96d

Please sign in to comment.