#25762 [Opn->Bgs]: array_merge returns NULL if one input array isn't set
| From: | iliaa@php.net | Date: | Mon, 06 Oct 2003 20:16:34 +0000 |
| Subject: | #25762 [Opn->Bgs]: array_merge returns NULL if one input array isn't set | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-48602@lists.php.net to get a copy of this message | ||
ID: 25762
Updated by: iliaa@php.net
Reported By: flaimo at gmx dot net
-Status: Open
+Status: Bogus
Bug Type: Arrays related
Operating System: win xp
PHP Version: 5CVS-2003-10-06 (dev)
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
All arguments to the function must be arrays, otherwise the function
will fail. That is to be expected.
Previous Comments:
------------------------------------------------------------------------
[2003-10-06 14:05:39] flaimo at gmx dot net
Description:
------------
if i use array_merge with two arrays, where one array-variable isn't
set, the function returns NULL instead of the values of the other
array.
Reproduce code:
---------------
<?php
error_reporting(E_ALL & E_NOTICE);
$array2 = array(1, 'a', TRUE);
$array3 = array_merge($array2, $array1); // $array1 isn't set
var_dump($array3);
?>
Expected result:
----------------
works like this in PHP4:
undefined variable array1;
should return array(1, 'a', true);
Actual result:
--------------
behaves like this in PHP5 snap:
undefined variable array1;
returns NULL;
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25762&edit=1