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
<?php declare(strict_types = 1); use function PHPStan\dumpType; /** * @param array{foo: string, bar: int} $bar */ function foo(array $bar): void { dumpType($bar + []); // nice dumpType($bar + ['zzz' => 1]); // very well! // all the examples below are faulty dumpType(array_merge($bar)); dumpType(array_merge($bar, [])); dumpType(array_merge($bar, ['zzz' => 1])); }
https://phpstan.org/r/bb21ada0-44aa-4592-bec8-57fd8f958be9
Array concatenation works well, but array_merge drops the known type. Would be really nice to preserve known types there too.
Warm welcome v1!
The text was updated successfully, but these errors were encountered:
duplicate of #5846 which shoule be fixed by phpstan/phpstan-src#696 ?
Sorry, something went wrong.
Nice, thank you!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
No branches or pull requests
Feature request
https://phpstan.org/r/bb21ada0-44aa-4592-bec8-57fd8f958be9
Array concatenation works well, but array_merge drops the known type.
Would be really nice to preserve known types there too.
Did PHPStan help you today? Did it make you happy in any way?
Warm welcome v1!
The text was updated successfully, but these errors were encountered: