comparison from the end of string.
@ -5770,6 +5770,10 @@ PHP_FUNCTION(substr_compare)
RETURN_FALSE;
}
if (offset < 0) { /* negative offset, start comparison at the end of string */
offset = s1_len + offset;
if (len && offset >= s1_len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The start position cannot exceed initial string length.");