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
It looks like assigning a variable in a is_string function does not "set" the variable type for PHPStan.
is_string
https://phpstan.org/r/975081af-96ab-4ef5-b6b3-6cc5158db03f
There should be no PHPStan issue. $path is a string.
$path
The text was updated successfully, but these errors were encountered:
@fancyweb After the latest commit in dev-master, PHPStan now reports different result with your code snippet:
@@ @@ -PHP 8.0 (1 error) -========== - -11: Parameter #1 $string of function rtrim expects string, string|false|null given. - -PHP 7.1 – 7.4 (1 error) -========== - -11: Parameter #1 $str of function rtrim expects string, string|false|null given. +No errors
Sorry, something went wrong.
Fixed: phpstan/phpstan-src@b2bf703
Regression tests
1afc353
Closes phpstan/phpstan#4761 Closes phpstan/phpstan#3331 Closes phpstan/phpstan#3106 Closes phpstan/phpstan#2640 Closes phpstan/phpstan#2413 Closes phpstan/phpstan#3446
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.
No branches or pull requests
Bug report
It looks like assigning a variable in a
is_string
function does not "set" the variable type for PHPStan.Code snippet that reproduces the problem
https://phpstan.org/r/975081af-96ab-4ef5-b6b3-6cc5158db03f
Expected output
There should be no PHPStan issue.
$path
is a string.The text was updated successfully, but these errors were encountered: