php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30871 Misleading warning message for array_combine()
Submitted: 2004-11-23 11:31 UTC Modified: 2005-03-21 20:46 UTC
From: tcarter at noggin dot com dot au Assigned: andrey (profile)
Status: Closed Package: Arrays related
PHP Version: 5CVS-2005-03-06 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tcarter at noggin dot com dot au
New email:
PHP Version: OS:

 

 [2004-11-23 11:31 UTC] 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. 
   


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-06 18:45 UTC] sniper@php.net
Verified and agreed it should not behave like this..

 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Fri Oct 19 07:01:25 2018 UTC