#35494 [Bgs]: Array merge problem

2005-12-02 Thread marek dot rybar at dial dot sk
 ID:   35494
 User updated by:  marek dot rybar at dial dot sk
 Reported By:  marek dot rybar at dial dot sk
 Status:   Bogus
 Bug Type: Arrays related
 Operating System: Windows, Linux
 PHP Version:  5.1.1
 New Comment:

Why do you think that is bogus? If it's true, please remove from manual
this passage:

If you want to completely preserve the arrays and just want to append
them to each other, use the + operator:
?php
$array1 = array();
$array2 = array(1 = data);
$result = $array1 + $array2;
?

because $result is $array1 not $array1 + $array2

:-((


Previous Comments:


[2005-11-30 17:27:34] [EMAIL PROTECTED]

Expected behaviour.
Use array_merge_recursive() to get the result you expect.



[2005-11-30 17:20:41] marek dot rybar at dial dot sk

Description:

When I merge two arrays using + operator, result is array only with the
first array elements.

Reproduce code:
---
$arr1 = array(1, 2, 3);
$arr2 = array(5, 6, 7);
$arr = $arr1 + $arr2;

result $arr:
array(1, 2, 3)






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


#35494 [NEW]: Array merge problem

2005-11-30 Thread marek dot rybar at dial dot sk
From: marek dot rybar at dial dot sk
Operating system: Windows, Linux
PHP version:  5.1.1
PHP Bug Type: Arrays related
Bug description:  Array merge problem

Description:

When I merge two arrays using + operator, result is array only with the
first array elements.

Reproduce code:
---
$arr1 = array(1, 2, 3);
$arr2 = array(5, 6, 7);
$arr = $arr1 + $arr2;

result $arr:
array(1, 2, 3)


-- 
Edit bug report at http://bugs.php.net/?id=35494edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=35494r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=35494r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=35494r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35494r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=35494r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=35494r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=35494r=needscript
Try newer version:http://bugs.php.net/fix.php?id=35494r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=35494r=support
Expected behavior:http://bugs.php.net/fix.php?id=35494r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=35494r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=35494r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35494r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=35494r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35494r=dst
IIS Stability:http://bugs.php.net/fix.php?id=35494r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=35494r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=35494r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=35494r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=35494r=mysqlcfg