Bug #70649 [Opn->Nab]: Array_sum when array content are nuls

From: Date: Tue, 06 Oct 2015 19:56:42 +0000
Subject: Bug #70649 [Opn->Nab]: Array_sum when array content are nuls
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196437@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70649&edit=1 ID: 70649 Updated by: requinix@php.net Reported by: marc dot lazzaro at st dot com Summary: Array_sum when array content are nuls -Status: Open +Status: Not a bug Type: Bug Package: Arrays related Operating System: Windows XP PHP Version: 5.4.45 Block user comment: N Private report: N New Comment: null+null+null=0 Previous Comments: ------------------------------------------------------------------------ [2015-10-06 11:50:41] marc dot lazzaro at st dot com Description: ------------ --- From manual page: http://www.php.net/function.array-sum --- $arr = array(null,null,null); $sum = array_sum($arr); expected value = null returned value = 0 Test script: --------------- $arr = array(null,null,null); $sum = array_sum($arr); echo $sum; Expected result: ---------------- NULL Actual result: -------------- 0 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70649&edit=1

« previous php.bugs (#196437) next »