diff --git a/tests/PHPStan/Rules/Operators/InvalidBinaryOperationRuleTest.php b/tests/PHPStan/Rules/Operators/InvalidBinaryOperationRuleTest.php index 41c947e937..a656898b2a 100644 --- a/tests/PHPStan/Rules/Operators/InvalidBinaryOperationRuleTest.php +++ b/tests/PHPStan/Rules/Operators/InvalidBinaryOperationRuleTest.php @@ -798,4 +798,16 @@ public function testBenevolentUnion(): void ]); } + public function testBug7863(): void + { + $this->checkImplicitMixed = true; + + $this->analyse([__DIR__ . '/data/bug-7863.php'], [ + [ + 'Binary operation "+" between mixed and array results in an error.', + 10, + ], + ]); + } + } diff --git a/tests/PHPStan/Rules/Operators/data/bug-7863.php b/tests/PHPStan/Rules/Operators/data/bug-7863.php new file mode 100644 index 0000000000..3a848d6769 --- /dev/null +++ b/tests/PHPStan/Rules/Operators/data/bug-7863.php @@ -0,0 +1,11 @@ +