From: enygma at phpdeveloper dot org
Operating system: Red Hat Linux
PHP version: 4.3.2
PHP Bug Type: *General Issues
Bug description: array_merge allowing "false" as argument

Description:
------------
Code:
---------------------------------------
$array1=false;
$array2=array("test"=>"1","testing"=>"2");
$last_array=array_merge($array1,$array2);
echo "<pre>"; print_r($last_array); echo "</pre>";
---------------------------------------

Result:
---------------------------------------
Array
(
[0] =>
[test] => 1
[testing] => 2
)
---------------------------------------

Please note that not only does array_merge allow the "false" to be passed
in, but when it is, a mysterious [0] appears in the results (null array
value?)

Reproduce code:
---------------
<?php
$array1=false;
$array2=array("test"=>"1","testing"=>"2");
$last_array=array_merge($array1,$array2);
echo "<pre>"; print_r($last_array); echo "</pre>";
?>

Expected result:
----------------
Either an "invalid argument" for the "false" being passed in, or no extra
Null array value appended to the resulting array.

Actual result:
--------------
Array
(
[0] =>
[test] => 1
[testing] => 2
)

--
Edit bug report at [url]http://bugs.php.net/?id=25494&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=25494&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=25494&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=25494&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=25494&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=25494&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=25494&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=25494&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=25494&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=25494&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=25494&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=25494&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=25494&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=25494&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=25494&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=25494&r=gnused[/url]