#24198 [NEW]: array_merge_recurcive

From: Date: Mon, 16 Jun 2003 06:43:28 +0000
Subject: #24198 [NEW]: array_merge_recurcive
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-42000@lists.php.net to get a copy of this message
From: camka at email dot ee Operating system: win 2000 PHP version: 4.3.2 PHP Bug Type: *General Issues Bug description: array_merge_recurcive Description: ------------ When var_dumping $f it appears a notice message, saying Warning: array_merge_recursive(): recursion detected in ... It is kind of strange because as far as I expect it is supposed to be the same result as in the line where $e is being var_dumped. var_dump($e) gives correct result: array 'a' => array 0 => 'aa' 1 => 'aa' 'b' => array 0 => 'bb' 1 => 'bb' and var_dump($f) gives notece message and result is array 'a' => 'aa' 'b' => 'bb' problem appears in 4.3.1 too, but not in 4.2.2 Reproduce code: --------------- <?php $c=array('a' => 'aa','b' => 'bb'); $d=array('a' => 'aa','b' => 'bb'); $a=$c; $b=$c; $f=array_merge_recursive($a,$b); var_dump($f); $e=array_merge_recursive($c,$d); var_dump($e); ?> Expected result: ---------------- array 'a' => array 0 => 'aa' 1 => 'aa' 'b' => array 0 => 'bb' 1 => 'bb' array 'a' => array 0 => 'aa' 1 => 'aa' 'b' => array 0 => 'bb' 1 => 'bb' Actual result: -------------- Warning: array_merge_recursive(): recursion detected in c:\servak\www\tests\array_merge_recursive.php on line 9 array 'a' => 'aa' 'b' => 'bb' array 'a' => array 0 => 'aa' 1 => 'aa' 'b' => array 0 => 'bb' 1 => 'bb' -- Edit bug report at http://bugs.php.net/?id=24198&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=24198&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=24198&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24198&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24198&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24198&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24198&r=support Expected behavior: http://bugs.php.net/fix.php?id=24198&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24198&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24198&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24198&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24198&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24198&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24198&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24198&r=gnused

« previous php.bugs (#42000) next »