Skip to content

Commit 49cf967

Browse files
ondrejmirtesclaude
andcommitted
1 parent 7f47a1c commit 49cf967

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

‎tests/PHPStan/Rules/DeadCode/UnusedVariableRuleTest.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,14 @@ public function testBug12012(): void
207207
]);
208208
}
209209

210+
public function testBug11483(): void
211+
{
212+
$this->analyse([__DIR__ . '/data/bug-11483.php'], [
213+
[
214+
'Value assigned to variable $hello is never read.',
215+
9,
216+
],
217+
]);
218+
}
219+
210220
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug11483;
4+
5+
class HelloWorld
6+
{
7+
public function sayHello(): void
8+
{
9+
$hello = 'he';
10+
$hello = 'llo';
11+
echo $hello;
12+
}
13+
}

0 commit comments

Comments
 (0)