From:             stochnagara at hotmail dot com
Operating system: 
PHP version:      5.1.0RC1
PHP Bug Type:     Feature/Change Request
Bug description:  Change array_combine behavoiur

Description:
------------
Currently array_combine returns false and raises a warning if it is used
with two empty array and this is documented too.
This is quite inconsistent since combining two empty arrays is expected to
result in another empty array.
If there are so many BC arguments, then this function could be extended
with a third optional argument 'accept_empty' which allow the thing I
request.

P.S. Actually bug #29972 is almost the same and has been marked closed so
this could be a reopen of this bug.

Reproduce code:
---------------
<?php
var_dump (array_combine (array(), array()));
?>


Expected result:
----------------
array(0) { }

Actual result:
--------------
Warning: array_combine() [function.array-combine]: Both parameters should
have at least 1 element in C:\Program Files\Apache
Group\Apache2\htdocs\boroinvest\test.php on line 3
bool(false) 

-- 
Edit bug report at http://bugs.php.net/?id=34857&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34857&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34857&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34857&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34857&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34857&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34857&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34857&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34857&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34857&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34857&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34857&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34857&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34857&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34857&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34857&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34857&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34857&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34857&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34857&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34857&r=mysqlcfg

Reply via email to