We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug A clear and concise description of what the bug is.
To Reproduce
function world(string $a): void { } /** @param array<string> $a */ function hello(array $a): void { $bestValue = null; foreach ($a as $test) { if ($bestValue === null) { $bestValue = $test; } else { var_dump($bestValue); world($bestValue); } } } hello(['hello', 'world']);
Expected behavior Type is string, not never
Screenshots
Platform and version 1.12.4
The text was updated successfully, but these errors were encountered:
There's currently a limitation in the control flow analysis implementation. A workaround is to widen the type with an annotation.
/** @var string|null $bestValue */ $bestValue = null;
Sorry, something went wrong.
No branches or pull requests
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Expected behavior
Type is string, not never
Screenshots
Platform and version
1.12.4
The text was updated successfully, but these errors were encountered: