diff --git a/src/Psalm/Checker/Statements/Expression/BinaryOpChecker.php b/src/Psalm/Checker/Statements/Expression/BinaryOpChecker.php index dfb72aa8f..0afd9db72 100644 --- a/src/Psalm/Checker/Statements/Expression/BinaryOpChecker.php +++ b/src/Psalm/Checker/Statements/Expression/BinaryOpChecker.php @@ -651,7 +651,7 @@ class BinaryOpChecker return; } - if ($right_type->isNullable() && $right_type->ignore_falsable_issues) { + if ($right_type->isNullable() && !$right_type->ignore_nullable_issues) { if ($statements_source && IssueBuffer::accepts( new PossiblyNullOperand( 'Right operand cannot be nullable, got ' . $right_type, diff --git a/tests/BinaryOperationTest.php b/tests/BinaryOperationTest.php index b378560fa..22c542f75 100644 --- a/tests/BinaryOperationTest.php +++ b/tests/BinaryOperationTest.php @@ -217,6 +217,11 @@ class BinaryOperationTest extends TestCase $a++;', 'error_message' => 'InvalidOperand', ], + 'possiblyDivByZero' => [ + ' 'PossiblyNullOperand', + ], ]; } }