php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #32277 Bogus example given for array_merge()
Submitted: 2005-03-11 13:35 UTC Modified: 2005-03-31 17:28 UTC
From: a at b dot c dot de Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: N/A
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: a at b dot c dot de
New email:
PHP Version: OS:

 

 [2005-03-11 13:35 UTC] a at b dot c dot de
Description:
------------
Para 3 of the text reads:
"If only one [associative] array is given ... duplicate entries will be merged into the last one. See example three for details."

And example 3 shows:

$array_two = array("jay" => "bob", "randal" => "dante", "jay" => "jason");
$result_two = array_merge($array_two);
print_r($result_two);

Since when has an associative array been able to contain duplicated keys ("jay", in this case)? The array_merge() in the given example is a complete no-op, as a print_r($array_two) shows.

Since "duplicate entries" never occur in associative arrays, there doesn't seem to be much point discussing what happens when array_merge() encounters them.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-31 17:28 UTC] vrana@php.net
Example was removed at 2005/02/16 15:27:02.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Aug 04 06:00:03 2025 UTC