Skip to content

Commit 6b5fb74

Browse files
committed
test mixed, array
1 parent 3dc3d3e commit 6b5fb74

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/PHPStan/Analyser/nsrt/bug-12393b.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,3 +322,31 @@ public function doFoo(string $b): void
322322
}
323323

324324
}
325+
326+
class FooMixedToInt
327+
{
328+
329+
public int $foo;
330+
331+
public function doFoo(mixed $b): void
332+
{
333+
$this->foo = $b;
334+
assertType('int', $this->foo);
335+
}
336+
337+
}
338+
339+
340+
class FooArrayToInt
341+
{
342+
343+
public int $foo;
344+
345+
public function doFoo(array $arr): void
346+
{
347+
$this->foo = $arr;
348+
assertType('*NEVER*', $this->foo);
349+
}
350+
351+
}
352+

0 commit comments

Comments
 (0)