#32277 [NEW]: Bogus example given for array_merge()

From: Date: Fri, 11 Mar 2005 12:35:55 +0000
Subject: #32277 [NEW]: Bogus example given for array_merge()
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969367720@lists.php.net to get a copy of this message
From: a at b dot c dot de Operating system: N/A PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: Bogus example given for array_merge() 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 bug report at http://bugs.php.net/?id=32277&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32277&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32277&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32277&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32277&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32277&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32277&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32277&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32277&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32277&r=support Expected behavior: http://bugs.php.net/fix.php?id=32277&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32277&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32277&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32277&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32277&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32277&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32277&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32277&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32277&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32277&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32277&r=mysqlcfg

« previous php.doc (#969367720) next »