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

sscanf array bug #7764

Closed
Alkarex opened this issue Aug 9, 2022 · 4 comments · Fixed by phpstan/phpstan-src#1576
Closed

sscanf array bug #7764

Alkarex opened this issue Aug 9, 2022 · 4 comments · Fixed by phpstan/phpstan-src#1576

Comments

@Alkarex
Copy link

Alkarex commented Aug 9, 2022

PHPStan seems to assume that sscanf() returns an array of size 1.

Since PHPStan 1.7.15 (no problem with 1.7.14). Could be due to phpstan/phpstan-src#1434

Code snippet that reproduces the problem

https://phpstan.org/r/99167899-8984-4874-b79d-8834ff508aa9

image

Running that code in PHP returns:

Success
Array
(
    [0] => hello
    [1] => world
    [2] => 
)
@staabm
Copy link
Contributor

staabm commented Aug 9, 2022

I guess this will be fixed with phpstan/phpstan-src#1576

@Alkarex
Copy link
Author

Alkarex commented Aug 9, 2022

I guess this will be fixed with phpstan/phpstan-src#1576

Thanks @staabm and sorry that I somehow did not spot #7563 when searching for sscanf in the issues...

@staabm
Copy link
Contributor

staabm commented Aug 9, 2022

No worries. I will add a regression test for this issue as soon as I am back at that PR

@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 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants