Bug #14726 Updated: Array_sum destroys string values

From: Date: Thu, 27 Dec 2001 23:50:07 +0000
Subject: Bug #14726 Updated: Array_sum destroys string values
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-75152@lists.php.net to get a copy of this message
ID: 14726 Updated by: mfischer Reported By: coyote@i-hwy.net Old Status: Open Status: Closed Bug Type: Unknown/Other Function Operating System: Linux PHP Version: 4.0.5 New Comment: This behaviour has been changed in 4.0.6 (the passed array is no longer modified). I've added a note to the documentation. Thanks for the report. Closing. Previous Comments: ------------------------------------------------------------------------ [2001-12-27 18:05:23] coyote@i-hwy.net I'm using PHP 4.04pl1 on a linux box. Whenever I use the array_sum function on an array containing both string and numeric values, it does the sum of the numeric values properly, but turns all non-number values in the array into the value "0" (zero). I tried creating a function that copied the array into another variable so that it would not be operating on the original... but mysteriously, it still destroyed the string values in the _original_ array! I don't have access to upgrade to a newer version of PHP... but if I were able to convince someone to upgrade, would that particular problem be fixed? ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=14726&edit=1

« previous php.dev (#75152) next »