From c733d775803733313ce456652d83176a13632504 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 6 Sep 2005 07:36:12 +0000 Subject: [PATCH] x*10 -> 10*x (bug #34363), empty array without initial returns null git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@195243 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/array/functions/array-reduce.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/array/functions/array-reduce.xml b/reference/array/functions/array-reduce.xml index 4ec1bd794a..75a56a7e3c 100644 --- a/reference/array/functions/array-reduce.xml +++ b/reference/array/functions/array-reduce.xml @@ -1,5 +1,5 @@ - + @@ -24,6 +24,8 @@ a single value. If the optional initial is available, it will be used at the beginning of the process, or as a final result in case the array is empty. + If the array is empty and initial is not passed, + array_reduce returns &null;. @@ -56,7 +58,7 @@ $d = array_reduce($x, "rsum", 1); This will result in $b containing 15, $c containing - 1200 (= 1*2*3*4*5*10), and + 1200 (= 10*1*2*3*4*5), and $d containing 1.