New issue
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
mb_str_split
result can be an empty array
#7580
Comments
Maybe your snippet is not a good example, but I think in this case PHPStan actually knows that the array is always empty if you split |
You are right, I updated the example. The issue is present when non-empty-string type is passed. |
Ok, that looks better, I guess the |
I continued looking at this and apparently there are 2 issues here. Maybe I'll open a PR already for the first thing while figuring the second out hmm. I just could adapt all default types for |
This is how PHP works since the |
Ok thx, I saw in an old PR the info that this was changed in psalm as well to a non-empty-array but now I found vimeo/psalm#6493. That's enough for me to revert it back here too :) |
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. |
Bug report
Code snippet that reproduces the problem
demo: https://phpstan.org/r/b78dcbd0-6791-4090-b50b-599fa5593ac2
Expected output
no error
The text was updated successfully, but these errors were encountered: