From 30e8e8bca215a67b4d6a75d532b1ec3bb2cdb6b6 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 23 Sep 2024 15:53:44 +0200 Subject: [PATCH] Added regression test --- .../Operators/InvalidBinaryOperationRuleTest.php | 12 ++++++++++++ tests/PHPStan/Rules/Operators/data/bug-7863.php | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 tests/PHPStan/Rules/Operators/data/bug-7863.php 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 @@ +