Skip to content

Commit 1ad0b99

Browse files
committed
Dependent variables test
1 parent 4430549 commit 1ad0b99

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/PHPStan/Analyser/data/dependent-variable-certainty.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,19 @@ function (bool $a, bool $b): void
245245
}
246246
};
247247

248+
function (): void {
249+
$from = null;
250+
$to = null;
251+
if (rand(0, 1)) {
252+
$from = new \stdClass();
253+
$to = new \stdClass();
254+
}
255+
256+
if ($from !== null) {
257+
assertType('stdClass', $to);
258+
}
259+
};
260+
248261
/*function (bool $b, bool $c): void {
249262
if ($b) {
250263
if ($c) {

0 commit comments

Comments
 (0)