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

Incremented numeric-string should change to int/float #10122

Closed
janedbal opened this issue Nov 13, 2023 · 4 comments
Closed

Incremented numeric-string should change to int/float #10122

janedbal opened this issue Nov 13, 2023 · 4 comments
Labels
Milestone

Comments

@janedbal
Copy link
Contributor

Bug report

  • Type inference in following snippet does not respect PHP's behaviour, see https://3v4l.org/AetFk
  • The type of numeric-string after ++ or -- changes to float or int.

Code snippet that reproduces the problem

https://phpstan.org/r/15e99a70-0318-464a-b50e-b157a25bc3f4

Expected output

Dumped type to be int|float

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

No response

@janedbal
Copy link
Contributor Author

Question is if incrementing also regular string should not result in benevolent(?) union of string|int|float, there is some ongoing deprecation in PHP though.

@ondrejmirtes
Copy link
Member

Fixed phpstan/phpstan-src#2797

@janedbal
Copy link
Contributor Author

janedbal commented Apr 5, 2024

Thank you!

Copy link

github-actions bot commented May 7, 2024

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

No branches or pull requests

2 participants