#23816 [NEW]: modified array_merge_recursive: array_merge_clobber

From: Date: Mon, 26 May 2003 18:18:21 +0000
Subject: #23816 [NEW]: modified array_merge_recursive: array_merge_clobber
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-40453@lists.php.net to get a copy of this message
From: pacha_shevaev at mail dot ru Operating system: win2000 PHP version: 4.3.1 PHP Bug Type: Arrays related Bug description: modified array_merge_recursive: array_merge_clobber It's not probably a bug report but a suggestion. Guys please could you make built-in function array_merge_clobber that WOULDN'T append duplicate key/values like array_merge_recursive does? There's an example of such function in the php manual, in the array_merge_recursive section: function array_merge_clobber($a1,$a2) { if(!is_array($a1) || !is_array($a2)) return false; $newarray = $a1; foreach ($a2 as $key => $val) { if (is_array($val) && is_array($newarray[$key])) { $newarray[$key] = array_merge_clobber($newarray[$key],$val); } else { $newarray[$key] = $val; } } return $newarray; } Our application heavily depends on this function and it takes about 40% of overall script execution(very large and nested arrays)! I think many developers would agree to have this function interbally implemented. Maybe it's not the right place...but i have no idea where else i could ask about it... -- Edit bug report at http://bugs.php.net/?id=23816&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23816&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23816&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23816&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23816&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23816&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23816&r=support Expected behavior: http://bugs.php.net/fix.php?id=23816&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23816&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23816&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23816&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23816&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23816&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23816&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23816&r=gnused

« previous php.bugs (#40453) next »