Bug #14795: array_sum() modifies the specified array
| From: | jimw at apache dot org | Date: | Wed, 02 Jan 2002 11:19:22 +0000 |
| Subject: | Bug #14795: array_sum() modifies the specified array | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-75574@lists.php.net to get a copy of this message | ||
From: jimw@apache.org
Operating system: Debian unstable
PHP version: 4.1.0
PHP Bug Type: Arrays related
Bug description: array_sum() modifies the specified array
the documentation claims this behavior was changed after 4.0.6, but it
appears to behave the same in 4.1.0. (and i don't see a commit to
ext/standard/array.c that indicates any such change to array_sum.)
$a = array(1, 2, "foo");
print_r($a);
echo array_sum($a);
print_r($a);
results in:
Array
(
[0] => 1
[1] => 2
[2] => foo
)
3Array
(
[0] => 1
[1] => 2
[2] => 0
)
--
Edit bug report at: http://bugs.php.net/?id=14795&edit=1