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

shell_exec can return false #6177

Closed
VincentLanglet opened this issue Jul 26, 2021 · 3 comments · Fixed by #6178
Closed

shell_exec can return false #6177

VincentLanglet opened this issue Jul 26, 2021 · 3 comments · Fixed by #6178

Comments

@VincentLanglet
Copy link
Contributor

Related to phpstan/phpstan#5376 (reply in thread)
Seems like unlike is saying the php documentation, shell_exec can return false php/php-src#7306

But psalm consider the return type to be string|null
https://psalm.dev/r/36a3eb5fa8

Where should I update the return type definition ?

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/36a3eb5fa8
<?php

function foo(string $s): bool {
    /** @psalm-suppress ForbiddenCode */
    return false !== shell_exec($s);
}
Psalm output (using commit 82dfbbc):

ERROR: RedundantCondition - 5:12 - null|string can never contain false

@weirdan
Copy link
Collaborator

weirdan commented Jul 26, 2021

Where should I update the return type definition ?

Just dictionaries/CallMap.php (no changes to deltas are required).

@VincentLanglet
Copy link
Contributor Author

Thanks, #6178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants