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
4.0.0-beta.1
7.3.6
In the code example https://docs.phalconphp.com/4.0/en/helper#includes
echo Str::includes('start', 'start-a-horse');
Result expect true but false given
true
false
Because strpos() or mb_strpos may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE
strpos()
mb_strpos
cphalcon/phalcon/Helper/Str.zep
Line 364 in a0b25ed
Line 366 in a0b25ed
Use === for testing the return value
===
final public static function includes(string! needle, string! haystack) -> bool { if function_exists("mb_strpos") { return (bool) false !== mb_strpos(haystack, needle); } else { return (bool) false !== strpos(haystack, needle); } }
The text was updated successfully, but these errors were encountered:
Fixed in the 4.0.x branch. Feel free to open a new issue if the problem appears again. Thank you for contributing.
4.0.x
Sorry, something went wrong.
No branches or pull requests
4.0.0-beta.1
7.3.6
In the code example
https://docs.phalconphp.com/4.0/en/helper#includes
Result expect
true
butfalse
givenBecause
strpos()
ormb_strpos
may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSEcphalcon/phalcon/Helper/Str.zep
Line 364 in a0b25ed
cphalcon/phalcon/Helper/Str.zep
Line 366 in a0b25ed
Use
===
for testing the return valueThe text was updated successfully, but these errors were encountered: