|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-09-11 10:59 UTC] enygma at phpdeveloper dot org
[2003-09-11 11:42 UTC] andrey@php.net
[2003-09-11 11:42 UTC] jay@php.net
[2003-09-11 11:50 UTC] enygma at phpdeveloper dot org
[2003-09-11 12:11 UTC] andrey@php.net
[2003-09-11 13:57 UTC] jay@php.net
[2003-10-08 07:14 UTC] sniper@php.net
[2003-10-08 07:15 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 16:00:01 2025 UTC |
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 )