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 15f9c6af67
commit 2992ca1fa2

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);
}