-
Notifications
You must be signed in to change notification settings - Fork 660
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
False positive with base64_decode() #10052
Comments
I found these snippets: https://psalm.dev/r/1dbb7e9f9f<?php
$encryptedString = "";
$decryptedString = base64_decode($encryptedString);
if ($decryptedString === false) {
// throw some error
}
|
I just found But after reading the php manual page for base64_decode I am still not sure, if there might be other reasons for the function to return false, even when not in strict mode. |
As of right now the only cases where https://github.com/php/php-src/blob/master/ext/standard/base64.c#L282 |
As discussed, not a false positive. |
https://psalm.dev/r/1dbb7e9f9f
will lead to:
ERROR: [DocblockTypeContradiction](https://psalm.dev/155) - 4:5 - string does not contain false
I think base64_decode() can return string|false, so I do not understand why psalm is complaining here.
The text was updated successfully, but these errors were encountered: