Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit db07673

Browse files
fix: add tests from review
1 parent 8b91913 commit db07673

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎tests/PHPStan/Rules/Variables/DefinedVariableRuleTest.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,10 @@ public function testBug13353(): void
11811181
'Variable $bar might not be defined.',
11821182
11,
11831183
],
1184+
[
1185+
'Undefined variable: $bar',
1186+
20
1187+
]
11841188
]);
11851189
}
11861190

‎tests/PHPStan/Rules/Variables/data/bug-13353.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,13 @@
99
}
1010

1111
echo $$foo;
12+
13+
function () {
14+
$foo = 'bar';
15+
16+
if (!isset($$foo)) {
17+
echo 'Wololo';
18+
}
19+
20+
echo $$foo;
21+
};

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /