#30871 [Opn->Asn]: Misleading warning message for array_combine()
| From: | sniper@php.net | Date: | Sun, 06 Mar 2005 17:45:52 +0000 |
| Subject: | #30871 [Opn->Asn]: Misleading warning message for array_combine() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-77024@lists.php.net to get a copy of this message | ||
ID: 30871
Updated by: sniper@php.net
Reported By: tcarter at noggin dot com dot au
-Status: Open
+Status: Assigned
Bug Type: Arrays related
-Operating System: Linux x86
+Operating System: *
-PHP Version: 5.0.2
+PHP Version: 5CVS-2005-03-06
-Assigned To:
+Assigned To: andrey
New Comment:
Verified and agreed it should not behave like this..
Previous Comments:
------------------------------------------------------------------------
[2004-11-23 11:31:46] tcarter at noggin dot com dot au
Description:
------------
If array_combine() is called with two empty arrays it
produces the following warning
"Both parameters should have number of elements at least
0"
This warning is misleading, reading the manual entry for
array_combine(), it does say that FALSE will be returned
if empty arrays are passed, but the warning is confusing
and implies that empty arrays are acceptable and that
there is some other problem.
The warning should be changed to something like
"Both parameters should have at least 1 element"
Alternatively it would seem more logical (to me anyway)
for array_combine(array(), array()) to just return the
empty array, but I guess that would break backwards
compatibility.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30871&edit=1