From: name at email dot com Operating system: windows xp sp3 PHP version: 5.2.6 PHP Bug Type: Scripting Engine problem Bug description: array_merge_recursive() Warning recursion detected in...
Description: ------------ Calling array_merge_recursive() produces an unclear warning ("recursion detected in"...) and seems to be breaking the script. The above happens if two conditions are met: 1. there is a private/protected data member in the object (see code). 2. the merged arrays contain at least one same string as key. * please note: following code reproduces this problem on the latest snaps of both 5.2.6 and 5.3 Reproduce code: --------------- class A { private $variable; public function __construct() { $this->variable = 'foo'; } } $x = new A; $b = array_merge_recursive(array("name"=>$x),array("name"=>$x)); var_dump($b); Expected result: ---------------- see 'Actual result' below... Actual result: -------------- array(1) { ["name"]=> array(1) { ["�A�variable"]=> array(2) { [0]=> string(3) "foo" [1]=> string(3) "foo" } } } -- Edit bug report at http://bugs.php.net/?id=46283&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46283&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46283&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46283&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46283&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=46283&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46283&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46283&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46283&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46283&r=support Expected behavior: http://bugs.php.net/fix.php?id=46283&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46283&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46283&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46283&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46283&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46283&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46283&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46283&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46283&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46283&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46283&r=mysqlcfg