From 1eac9e966b2fced779c116f66ed9d3040a0c07a1 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Thu, 13 Jan 2022 13:15:57 +0100 Subject: [PATCH] Regression test Closes https://github.com/phpstan/phpstan/issues/5707 --- ...parisonOperatorsConstantConditionRuleTest.php | 5 +++++ tests/PHPStan/Rules/Comparison/data/bug-5707.php | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tests/PHPStan/Rules/Comparison/data/bug-5707.php diff --git a/tests/PHPStan/Rules/Comparison/NumberComparisonOperatorsConstantConditionRuleTest.php b/tests/PHPStan/Rules/Comparison/NumberComparisonOperatorsConstantConditionRuleTest.php index c1987ae689..7b68ee5a1d 100644 --- a/tests/PHPStan/Rules/Comparison/NumberComparisonOperatorsConstantConditionRuleTest.php +++ b/tests/PHPStan/Rules/Comparison/NumberComparisonOperatorsConstantConditionRuleTest.php @@ -83,4 +83,9 @@ public function testBug3153(): void $this->analyse([__DIR__ . '/data/bug-3153.php'], []); } + public function testBug5707(): void + { + $this->analyse([__DIR__ . '/data/bug-5707.php'], []); + } + } diff --git a/tests/PHPStan/Rules/Comparison/data/bug-5707.php b/tests/PHPStan/Rules/Comparison/data/bug-5707.php new file mode 100644 index 0000000000..3a93703d60 --- /dev/null +++ b/tests/PHPStan/Rules/Comparison/data/bug-5707.php @@ -0,0 +1,16 @@ + 0; --$l) { + } + + return 'x'; + } +}