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

Can't use result of is_numeric to determine ability to cast #3664

Closed
loevgaard opened this issue Jul 23, 2020 · 3 comments
Closed

Can't use result of is_numeric to determine ability to cast #3664

loevgaard opened this issue Jul 23, 2020 · 3 comments
Labels
Milestone

Comments

@loevgaard
Copy link

Bug report

I would have expected no errors in the code snippet below. If a $var is numeric I should be able to cast it to int, but it doesn't seem that phpstan recognizes this.

It works with is_scalar though.

Code snippet that reproduces the problem

https://phpstan.org/r/c684ee69-d6a4-4455-8d1f-82fd8ba46ae5

Expected output

No errors

@ondrejmirtes ondrejmirtes added this to the Easy fixes milestone Jul 27, 2020
@eigan
Copy link

eigan commented Jul 28, 2020

Duplicate of #3133 (which might be related to #3489 also)

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@7f04f75

@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 May 13, 2021
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

3 participants