-
-
Notifications
You must be signed in to change notification settings - Fork 938
Closed
Labels
Milestone
Description
https://phpstan.org/r/eae81481-04ee-44d2-8ee8-e573625aa034
class HelloWorld
{
const CONFIG = [
0 => ['foo' => false],
1 => ['foo' => false],
];
public function sayHello(int $key): void
{
$config = self::CONFIG[$key]['foo'] ?? true;
if ($config) {
print 'Foo';
}
}
}If condition is always false.
This only happens when the CONFIG is multidimensional. This here works:
Reactions are currently unavailable