-
-
Notifications
You must be signed in to change notification settings - Fork 935
Closed
phpstan/phpstan-src
#3028Labels
Description
Bug report
The following code should raise an error, but it passes with level 9 + strict rules.
Code snippet that reproduces the problem
<?php declare(strict_types = 1);
/**
* @param array<mixed> $array
* @return mixed
*/
function foo(array $array) {
return $array['foo'];
}
https://phpstan.org/r/5347b67e-f0ad-4505-aeca-cfb074dcb3e7
Expected output
It should raise an error about possibly undefined array offset, same way as psalm does. Quite obvious.
keradus