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
hrtime() result is always int
on 64-bit
#3650
Comments
This is too much of an edge-case, not gonna fix it. |
In what way it is an edge-case? With every usage of |
In the sense that I don't want PHPStan to care about 32-bit vs. 64-bit. But I actually fixed the false positive: phpstan/phpstan-src@2a39e5a |
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. |
Bug report
hrtime()
has a platform-dependent return type: on 32-bit,hrtime(true)
returnsfloat
, but on 64-bit it returnsint
.Code snippet that reproduces the problem
https://phpstan.org/r/b72181f9-ad67-4b9c-b201-43b362fff064
Expected output
No error.
Additional notes
It might be a good idea to read composer.json to check for
php-64bit
requirement, or have somephpstan.neon
flag that allows specifying the arch, because this is not the only thing that has arch-dependent behaviour (for example https://phpstan.org/r/f64df3f6-d49d-4f09-b70a-f18e85182b8f).The text was updated successfully, but these errors were encountered: