diff --git a/tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php b/tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php index c8dcafd23b..2b571f01e8 100644 --- a/tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php +++ b/tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php @@ -450,4 +450,10 @@ public function testBug1707(): void $this->analyse([__DIR__ . '/data/bug-1707.php'], []); } + public function testBug3357(): void + { + $this->checkAlwaysTrueStrictComparison = true; + $this->analyse([__DIR__ . '/data/bug-3357.php'], []); + } + } diff --git a/tests/PHPStan/Rules/Comparison/data/bug-3357.php b/tests/PHPStan/Rules/Comparison/data/bug-3357.php new file mode 100644 index 0000000000..19ba5a05fb --- /dev/null +++ b/tests/PHPStan/Rules/Comparison/data/bug-3357.php @@ -0,0 +1,21 @@ + '']; + + assert($foo === ['foo' => '']); +};