We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3dc3d3e commit 6b5fb74Copy full SHA for 6b5fb74
tests/PHPStan/Analyser/nsrt/bug-12393b.php
@@ -322,3 +322,31 @@ public function doFoo(string $b): void
322
}
323
324
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
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