summaryrefslogtreecommitdiff
path: root/ext/standard/string.c
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-09-10 13:28:18 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-09-15 14:26:16 +0200
commitc37a1cd650a5399c4a89543759deedcc7280becd (patch)
tree3a36dcdb3a20042ce3f37b3b534cbc5fbec7d1d4 /ext/standard/string.c
parent62c20c662a961f030178a15311bfe37591c10316 (diff)
downloadphp-git-c37a1cd650a5399c4a89543759deedcc7280becd.tar.gz
Promote a few remaining errors in ext/standard
Closes GH-6110
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r--ext/standard/string.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index b3d357baa8..7e6f05ad71 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -5421,7 +5421,7 @@ PHP_FUNCTION(substr_count)
ZEND_PARSE_PARAMETERS_END();
if (needle_len == 0) {
- zend_argument_value_error(2, "must be a non-empty string");
+ zend_argument_value_error(2, "cannot be empty");
RETURN_THROWS();
}
@@ -5443,8 +5443,8 @@ PHP_FUNCTION(substr_count)
length += (haystack_len - offset);
}
if (length < 0 || ((size_t)length > (haystack_len - offset))) {
- php_error_docref(NULL, E_WARNING, "Invalid length value");
- RETURN_FALSE;
+ zend_argument_value_error(4, "must be contained in argument #1 ($haystack)");
+ RETURN_THROWS();
}
endp = p + length;
}
@@ -5908,8 +5908,8 @@ PHP_FUNCTION(substr_compare)
}
if ((size_t)offset > ZSTR_LEN(s1)) {
- php_error_docref(NULL, E_WARNING, "The start position cannot exceed initial string length");
- RETURN_FALSE;
+ zend_argument_value_error(3, "must be contained in argument #1 ($main_str)");
+ RETURN_THROWS();
}
cmp_len = len ? (size_t)len : MAX(ZSTR_LEN(s2), (ZSTR_LEN(s1) - offset));