From 01b266aac405c3c4c677d46f348dc6b227b69f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Wed, 18 Mar 2020 22:44:02 +0100 Subject: Improve error messages of various extensions Closes GH-5278 --- ext/pcre/php_pcre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/pcre/php_pcre.c') diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index fdc1b1b856..fc98542ef9 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -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(); } } -- cgit v1.2.1