Skip to content

Commit

Permalink
Merge pull request #9247 from aboyton/divide-zero
Browse files Browse the repository at this point in the history
Fixes #9246
  • Loading branch information
weirdan committed Feb 9, 2023
2 parents 4eacb2f + 5d97690 commit 375e5da
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -962,7 +962,7 @@ public static function arithmeticOperation(
} elseif ($operation instanceof PhpParser\Node\Expr\BinaryOp\ShiftRight) {
$result = $operand1 >> $operand2;
} elseif ($operation instanceof PhpParser\Node\Expr\BinaryOp\Div) {
if ($operand2 === 0) {
if ($operand2 === 0 || $operand2 === 0.0) {
return Type::getNever();
}

Expand Down

0 comments on commit 375e5da

Please sign in to comment.