Skip to content

Commit 3390263

Browse files
committed
added regression test
1 parent 78ab9e4 commit 3390263

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,4 +1011,9 @@ public function testBug12748(): void
10111011
$this->analyse([__DIR__ . '/data/bug-12748.php'], []);
10121012
}
10131013

1014+
public function testBug11019(): void
1015+
{
1016+
$this->analyse([__DIR__ . '/data/bug-11019.php'], []);
1017+
}
1018+
10141019
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Bug11019;
4+
5+
class HelloWorld
6+
{
7+
public static int $a;
8+
9+
public function reset(): void
10+
{
11+
static::$a = rand(1,10);
12+
}
13+
14+
public function sayHello(): void
15+
{
16+
$this->reset();
17+
assert(static::$a === 1);
18+
$this->reset();
19+
assert(static::$a === 1);
20+
}
21+
}

0 commit comments

Comments
 (0)