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

Incorrect key type for superglobals - key can be int #9306

Closed
schlndh opened this issue May 12, 2023 · 2 comments
Closed

Incorrect key type for superglobals - key can be int #9306

schlndh opened this issue May 12, 2023 · 2 comments

Comments

@schlndh
Copy link

schlndh commented May 12, 2023

Bug report

PHPStan assumes that array keys of superglobals such as $_GET, $_POST, ... must be string. But due to the fact that "int strings" are automatically cast to int when used as array keys, they can be int|string.

It seems that the relevant line is here.

Code snippet that reproduces the problem

https://phpstan.org/r/69510a71-e73a-4664-ac15-9e15f83a4893

Expected output

No issue.

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src#2446

@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 Jul 11, 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