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
Fix 10431: Add false return type in exec
method
#2974
Conversation
can |
Looking at the issue https://phpstan.org/r/3fe47f5e-f27b-4b4e-9594-5e7e0e6e8313, currently Looking at https://www.php.net/manual/en/function.exec.php there is
So I think it doesn't return false on php8. But the fix seems to be different, since we rely on phpstan/php-8 stubs |
it can return |
So, there is nothing to change on PHP8. But we still need to add |
Right. The PR seems valid to adjust php7 types |
Sorry, thanks 😊 |
Just to make sure we are on the same page, we are talking about the case where Shouldn't this be a benevolent union type? I.e. it does not error if you do check for false, but it does not complain in case you do not? |
@thg2k I think your reasoning might be true for php8+ (which did not change with this PR), but on php7 - which this PR is changing the return type for - |
What do you mean with "all error situations"? AFAIK, the only difference for Anyway, I was just wondering.. after all the offiicial prototype includes |
the php.net manual says
so I think e.g. |
Closes phpstan/phpstan#10431