#46283 [Opn->Bgs]: array_merge_recursive() Warning recursion detected in...

From: Date: Thu, 30 Apr 2009 09:20:17 +0000
Subject: #46283 [Opn->Bgs]: array_merge_recursive() Warning recursion detected in...
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-136554@lists.php.net to get a copy of this message
 ID:               46283
 Updated by:       jani@php.net
 Reported By:      name at email dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Arrays related
 Operating System: *
 PHP Version:      5CVS-2008-11-17
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php




Previous Comments:
------------------------------------------------------------------------

[2008-12-26 00:09:53] name at email dot com

@jani

from the doc:

"If the input arrays have the same string keys, then the values for
these keys are merged together into an array, and this is done
recursively, so that if one of the values is an array itself, the
function will merge it with a corresponding entry in another array
too."

in the example i gave both values are Objects themselves and so i
understand that the values of the same string keys should be merged INTO
an array but not AS arrays.

did i understand correctly?

------------------------------------------------------------------------

[2008-12-19 01:39:09] jani@php.net

Explain "preserve" ?

------------------------------------------------------------------------

[2008-11-28 20:04:02] name at email dot com

@lbarnaud

you are correct about the warning.
it might be unrelated to this problem, i thought it was.

about the weird output,
i thought the function supposed to preserve the object, please correct
me if im wrong.

thanks

------------------------------------------------------------------------

[2008-11-26 02:41:32] lbarnaud@php.net

I can't reproduce with 5.3CVS (no warnings).

The weird output is caused by two null bytes and the class name added
to private properties. You get the same output when casting a class to
an array.

------------------------------------------------------------------------

[2008-11-17 13:42:33] name at email dot com

@jani

PHP Version 5.2.7RC4-dev
Build Date 	Nov 17 2008 11:39:11 

array(1) {
  ["name"]=>
  array(1) {
    ["�A�variable"]=>
    array(2) {
      [0]=>
      string(3) "foo"
      [1]=>
      string(3) "foo"
    }
  }
}

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/46283

-- 
Edit this bug report at http://bugs.php.net/?id=46283&edit=1



Thread (12 messages)

« previous php.bugs (#136554) next »