#25762 [NEW]: array_merge returns NULL if one input array isn't set
| From: | flaimo at gmx dot net | Date: | Mon, 06 Oct 2003 18:05:41 +0000 |
| Subject: | #25762 [NEW]: array_merge returns NULL if one input array isn't set | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-48589@lists.php.net to get a copy of this message | ||
From: flaimo at gmx dot net
Operating system: win xp
PHP version: 5CVS-2003-10-06 (dev)
PHP Bug Type: Arrays related
Bug description: array_merge returns NULL if one input array isn't set
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 bug report at http://bugs.php.net/?id=25762&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25762&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25762&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25762&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25762&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25762&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25762&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25762&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25762&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25762&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25762&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25762&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25762&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25762&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25762&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25762&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=25762&r=float