ID: 46283
User updated by: name at email dot com
Reported By: name at email dot com
-Status: No Feedback
+Status: Open
Bug Type: Arrays related
Operating System: *
PHP Version: 5CVS-2008-10-12
New Comment:
feedback exists from Oct 29 (2nd comment), status was not changed.
now it is. Open.
Previous Comments:
------------------------------------------------------------------------
[2008-11-03 01:00:03] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2008-10-29 15:18:38] name at email dot com
@jani
1. passing two arrays.
2. they both contain a reference to an object.
3. i expect the function to preserve the structure of the object.
4. notice: ["�A�variable"] <-- whats that?
------------------------------------------------------------------------
[2008-10-26 19:19:46] [EMAIL PROTECTED]
What's the problem here? You're passing an object to a function
expecting arrays and think it will work..?
------------------------------------------------------------------------
[2008-10-12 22:14:15] name at email dot com
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 this bug report at http://bugs.php.net/?id=46283&edit=1