Improve error messages of various extensions

Closes GH-5278
This commit is contained in:
Máté Kocsis 2020-03-18 22:44:02 +01:00
parent d7b73de8c9
commit 01b266aac4
No known key found for this signature in database
GPG key ID: FD055E41728BF310
29 changed files with 100 additions and 100 deletions

View file

@ -2303,7 +2303,7 @@ static void preg_replace_common(INTERNAL_FUNCTION_PARAMETERS, int is_filter)
}
} else {
if (Z_TYPE_P(regex) != IS_ARRAY) {
zend_type_error("Parameter mismatch, pattern is a string while replacement is an array");
zend_argument_type_error(1, "must be of type array when argument #2 ($replace) is an array, %s given", zend_zval_type_name(regex));
RETURN_THROWS();
}
}