We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://phpstan.org/r/cd41cbe6-b757-4d79-b345-cbc660f00d1e
assertType("1", intval("1")); assertType("100", intval("100")); assertType("0", filter_var("0", FILTER_VALIDATE_INT)); assertType("1", filter_var("1", FILTER_VALIDATE_INT)); assertType("100", filter_var("100", FILTER_VALIDATE_INT)); assertType("false", filter_var("abc", FILTER_VALIDATE_INT)); assertType("null", filter_var("abc", FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE)); // for octal assertType("8", filter_var("0o10", FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_OCTAL)); // for hex assertType("16", filter_var("0x10", FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_HEX));
intval can cast ConstantString like1 , but filter_var cannot.
intval
ConstantString
1
filter_var
PHP is now properly typed and easier to develop with Emacs.
The text was updated successfully, but these errors were encountered:
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.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Feature request
https://phpstan.org/r/cd41cbe6-b757-4d79-b345-cbc660f00d1e
intval
can castConstantString
like1
, butfilter_var
cannot.Did PHPStan help you today? Did it make you happy in any way?
PHP is now properly typed and easier to develop with Emacs.
The text was updated successfully, but these errors were encountered: