php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #46765 array_merge documentation incorrectly states that "arrays will be preserved"
Submitted: 2008-12-05 14:29 UTC Modified: 2009-08-28 08:34 UTC
From: charonme at yahoo dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2008-12-05 14:29 UTC] charonme at yahoo dot com
Description:
------------
Related bug: http://bugs.php.net/bug.php?id=42323

array_merge documentation states: "If you want to completely preserve the arrays and just want to append them to each other (not overwriting the previous keys), use the + operator"

However, both arrays (plural) are not preserved, only the first array (singular) is preserved and the second array is NOT preserved if there are some keys that are already defined in the first array. The documentation needs to be clear enough to state that the second array might not be preserved at all even though the first array (singular) will always be preserved.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-28 08:34 UTC] svn@php.net
Automatic comment from SVN on behalf of torben
Revision: http://svn.php.net/viewvc/?view=revision&revision=287831
Log: Fixed an old incorrect description of array union.
Addresses bug #46765.
 [2009-08-28 08:34 UTC] torben@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Fri Jun 19 06:00:02 2026 UTC