Bug #14726: Array_sum destroys string values
| From: | coyote at i-hwy dot net | Date: | Thu, 27 Dec 2001 23:05:23 +0000 |
| Subject: | Bug #14726: Array_sum destroys string values | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-75148@lists.php.net to get a copy of this message | ||
From: coyote@i-hwy.net
Operating system: Linux
PHP version: 4.0.5
PHP Bug Type: Unknown/Other Function
Bug description: Array_sum destroys string values
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 bug report at: http://bugs.php.net/?id=14726&edit=1