#29972 [Opn->Csd]: array_combine issues warning on empty arrays
| From: | andrey@php.net | Date: | Mon, 11 Apr 2005 08:03:52 +0000 |
| Subject: | #29972 [Opn->Csd]: array_combine issues warning on empty arrays | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-76949@lists.php.net to get a copy of this message | ||
ID: 29972
Updated by: andrey@php.net
Reported By: sean at acidreign dot net
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: all
PHP Version: 5.0.1
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
the message is now ok
Previous Comments:
------------------------------------------------------------------------
[2004-09-03 18:48:54] sean at acidreign dot net
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)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29972&edit=1