#32277 [Opn->Csd]: Bogus example given for array_merge()

From: Date: Thu, 31 Mar 2005 15:28:41 +0000
Subject: #32277 [Opn->Csd]: Bogus example given for array_merge()
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969367741@lists.php.net to get a copy of this message
ID: 32277 Updated by: vrana@php.net Reported By: a at b dot c dot de -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: N/A PHP Version: Irrelevant New Comment: Example was removed at 2005/02/16 15:27:02. Previous Comments: ------------------------------------------------------------------------ [2005-03-11 13:35:55] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32277&edit=1

« previous php.doc (#969367741) next »