Fixed yoda operator

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-02-06 12:39:12 -08:00
parent b10ea0c25c
commit ec2afee57d

View file

@ -449,11 +449,11 @@ echo "--------------------------------------------------------\n\n";
function str_begins($haystack, $needle) {
return 0 === substr_compare($haystack, $needle, 0, strlen($needle));
return (substr_compare($haystack, $needle, 0, strlen($needle)) === 0);
}
function str_ends($haystack, $needle) {
return 0 === substr_compare($haystack, $needle, -strlen($needle));
return (substr_compare($haystack, $needle, -strlen($needle)) === 0);
}