Skip to content

Commit 7733eb3

Browse files
committed
fix: add tests from review
1 parent 3c9bd57 commit 7733eb3

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)