|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-04-11 10:03 UTC] andrey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 15:00:02 2025 UTC |
Description: ------------ array_combine issues a warning when empty arrays are passed as arguments, I submit that empty arrays should be valid input for this function, and the result should also be an empty array (rather than FALSE and a warning). On top of that, the warning is non-sensical, as it states that "Both parameters should have number of elements at least 0" Reproduce code: --------------- $a = array(); $b = array(); $c = array_combine( $a, $b ); var_dump( $c ); Expected result: ---------------- array(0) { } Actual result: -------------- Warning: array_combine() [function.array-combine]: Both parameters should have number of elements at least 0 in /var/www/vhosts/.../test.php on line 4 bool(false)