Skip to content
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

iterator passed to iterator_to_array generates type error #9818

Closed
Geekimo opened this issue Aug 29, 2023 · 3 comments
Closed

iterator passed to iterator_to_array generates type error #9818

Geekimo opened this issue Aug 29, 2023 · 3 comments

Comments

@Geekimo
Copy link

Geekimo commented Aug 29, 2023

Bug report

When passing an iterator to iterator_to_array, phpstan produces an error that it expects a traversable as first parameter.
PHP documentation explicitely says that iterable is a build-time alias for array| Traversable (see https://www.php.net/manual/en/language.types.iterable.php).

Code snippet that reproduces the problem

https://phpstan.org/r/cfe4f0bd-63f9-424a-8e68-912c56694c96

Expected output

Should not generate an error.

Did PHPStan help you today? Did it make you happy in any way?

No response

@ondrejmirtes
Copy link
Member

Duplicate of #7760

@ondrejmirtes ondrejmirtes marked this as a duplicate of #7760 Aug 29, 2023
@Geekimo
Copy link
Author

Geekimo commented Aug 29, 2023

Thanks @ondrejmirtes ! I did not found this one.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants