|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-04-16 18:27 UTC] levim@php.net
-Status: Open
+Status: Feedback
-Package: Feature/Change Request
+Package: *General Issues
-Operating System: win2000
+Operating System: Any
-PHP Version: 4.3.1
+PHP Version: *
[2014-04-16 18:27 UTC] levim@php.net
[2014-12-30 10:41 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 00:00:02 2025 UTC |
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...