Skip to content

Commit 31ba825

Browse files
committed
Fix bug in str_ends_with
1 parent 321267e commit 31ba825

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/standard/string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1899,7 +1899,7 @@ PHP_FUNCTION(str_ends_with) {
18991899
}
19001900

19011901
k = ZSTR_LEN(haystack) - ZSTR_LEN(needle);
1902-
RETURN_BOOL(memcmp(&(ZSTR_VAL(haystack))[k], &(ZSTR_VAL(needle))[k], ZSTR_LEN(needle)) == 0);
1902+
RETURN_BOOL(memcmp(&(ZSTR_VAL(haystack))[k], ZSTR_VAL(needle), ZSTR_LEN(needle)) == 0);
19031903
}
19041904

19051905
/* {{{ proto string strchr(string haystack, string needle)

0 commit comments

Comments
 (0)