php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14795 array_sum() modifies the specified array
Submitted: 2002-01-02 06:19 UTC Modified: 2002-04-24 11:24 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: jimw at apache dot org Assigned:
Status: Closed Package: Arrays related
PHP Version: 4.1.0 OS: Debian unstable
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jimw at apache dot org
New email:
PHP Version: OS:

 

 [2002-01-02 06:19 UTC] jimw at apache dot org
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
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-24 11:24 UTC] andrei@php.net
This bug has been fixed in CVS.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 11:01:31 2024 UTC