From 228bae7d74a7886f05716ef5ac0f3ba200caccc4 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 11 Aug 2019 14:28:10 +0200 Subject: Use TypeError for preg_replace type check This is a type violation warning, and as such should use TypeError in PHP 8. --- ext/pcre/php_pcre.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/pcre/php_pcre.c') diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 6002eedc78..4a603ec99d 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -2239,8 +2239,8 @@ static void preg_replace_common(INTERNAL_FUNCTION_PARAMETERS, int is_filter) } } else { if (Z_TYPE_P(regex) != IS_ARRAY) { - php_error_docref(NULL, E_WARNING, "Parameter mismatch, pattern is a string while replacement is an array"); - RETURN_FALSE; + zend_type_error("Parameter mismatch, pattern is a string while replacement is an array"); + return; } } -- cgit v1.2.1