#43693 [NEW]: array_fill_keys() value parameter, misleading array suggestion
| From: | stein at visibone dot com | Date: | Thu, 27 Dec 2007 21:11:39 +0000 |
| Subject: | #43693 [NEW]: array_fill_keys() value parameter, misleading array suggestion | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-385@lists.php.net to get a copy of this message | ||
From: stein at visibone dot com
Operating system:
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: array_fill_keys() value parameter, misleading array suggestion
Description:
------------
Description of the "value" parameter is misleading:
Either an string or an array of values
implying (or badly open to misinterpretation) that the "values" would be
applied to the output array, one "value" per element, as is
array_combine(). The truth is an array for the 2nd parameter would be used
as any other type would be: cloned for every value in the output array.
That should be explicit, e.g.:
Assigned to each and every element of the output array
Reproduce code:
---------------
array(1=>array(11,22), 2=>array(11,22))
==
array_fill_keys(array(1,2), array(11,22))
--
Edit bug report at http://bugs.php.net/?id=43693&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43693&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43693&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43693&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43693&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43693&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=43693&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43693&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43693&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43693&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43693&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43693&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=43693&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=43693&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43693&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43693&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43693&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43693&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43693&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43693&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43693&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43693&r=mysqlcfg