Skip to content

Commit 83f93dd

Browse files
Add test
1 parent de2d305 commit 83f93dd

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tests/PHPStan/Rules/Classes/ImpossibleInstanceOfRuleTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,10 @@ public function testBug10036(): void
513513
'Instanceof between stdClass and string|null results in an error.',
514514
19,
515515
],
516+
[
517+
'Instanceof between stdClass and array results in an error.',
518+
39,
519+
],
516520
]);
517521
}
518522

tests/PHPStan/Rules/Classes/data/bug-10036.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,14 @@ public function sayMixed(mixed $class): void
2828
{
2929
var_dump(new stdClass instanceof $class);
3030
}
31+
32+
public function sayObject(object $class): void
33+
{
34+
var_dump(new stdClass instanceof $class);
35+
}
36+
37+
public function sayArray(array $class): void
38+
{
39+
var_dump(new stdClass instanceof $class);
40+
}
3141
}

0 commit comments

Comments
 (0)