From: sean at acidreign dot net
Operating system: all
PHP version: 5.0.1
PHP Bug Type: Feature/Change Request
Bug description: array_combine issues warning on empty arrays
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 bug report at http://bugs.php.net/?id=29972&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29972&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=29972&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=29972&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=29972&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29972&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29972&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29972&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29972&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29972&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29972&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29972&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29972&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29972&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29972&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29972&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29972&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29972&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29972&r=float