From 7034533abcc7d29050d41931224968c39c0f8b00 Mon Sep 17 00:00:00 2001 From: sy-records <52o@qq52o.cn> Date: Fri, 13 Aug 2021 14:54:48 +0800 Subject: [PATCH] Fix array_combine throws ValueError since PHP 8 close https://github.com/php/doc-en/issues/849 --- reference/array/functions/array-combine.xml | 27 ++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/reference/array/functions/array-combine.xml b/reference/array/functions/array-combine.xml index 6c5330b31fdd..9a35e3d01b48 100644 --- a/reference/array/functions/array-combine.xml +++ b/reference/array/functions/array-combine.xml @@ -59,11 +59,36 @@ &reftitle.errors; - Throws E_WARNING if the number of elements in + As of PHP 8.0.0, a ValueError is thrown if the number of elements in keys and values does not match. + Prior to PHP 8.0.0, a E_WARNING was emitted instead. + + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.0.0 + + array_combine will now throw a + ValueError if the number of elements + for each array is not equal. + + + + + + &reftitle.examples;