-
Notifications
You must be signed in to change notification settings - Fork 663
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
mb_strtolower|upper does not return false #3287
Comments
I found these snippets: https://psalm.dev/r/d499c196d5<?php
/**
* @param list<string> $values
*/
function checkStrings(array $values): void {}
checkStrings(array_map('mb_strtolower', ['a']));
function checkString(string $value): void {}
checkString(mb_strtolower('a'));
|
It does in 7.4.5: https://github.com/php/php-src/blob/php-7.4.5/ext/mbstring/mbstring.c#L3532 (though the exact conditions are not clear to me right away). |
Seems like this was fixed since? |
@vudaltsov reopen if necessary. |
Hey, these functions have indeed changed since PHP 8 to not return false, but throw instead: 7.4.20: https://github.com/php/php-src/blob/php-7.4.20/ext/mbstring/tests/mb_strtolower_error2.phpt Maybe this could be fixed by adding the new signatures to the Could be useful to check the whole mbstring family while at it. |
Yes, PR is welcome 😄 |
https://psalm.dev/r/d499c196d5
https://www.php.net/manual/en/function.mb-strtolower.php
I can fix this tomorrow.
I was also surprised that the second example in the snippet passes. @muglug , is that okay?
The text was updated successfully, but these errors were encountered: