PHP 4.0 Bug #4522: Recursive array_merge() support

From: Date: Fri, 19 May 2000 17:43:57 +0000
Subject: PHP 4.0 Bug #4522: Recursive array_merge() support
Groups: php.dev 
Request: Send a blank email to php-dev+get-18981@lists.php.net to get a copy of this message
From: nathan@cjhunter.com Operating system: Linux 2.2.14 PHP version: 4.0 Release Candidate 1 PHP Bug Type: Feature/Change Request Bug description: Recursive array_merge() support If a key from two arrays is the same in an array_merge() function, sub merge those two key's values. array_merge() currently just replaces the other key. Here is an example of the current behavior. $a = array("x" => array(1,2,3)); $b = array("x" => array(4,5,6)); var_dump(array_merge($a, $b)); ---------------------------------- array(1) { ["x"]=> array(3) { [0]=> int(4) [1]=> int(5) [2]=> int(6) } } ------------- I would want it the output to be.. array(1) { ["x"]=> array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) } } Please mail me back with input. nathan@cjhunter.com

« previous php.dev (#18981) next »