php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #43693 array_fill_keys() value parameter, misleading array suggestion
Submitted: 2007-12-27 21:11 UTC Modified: 2008-05-11 14:12 UTC
From: stein at visibone dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant 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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: stein at visibone dot com
New email:
PHP Version: OS:

 

 [2007-12-27 21:11 UTC] stein at visibone dot com
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))


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-11 14:12 UTC] mattwil@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

Changed to "Value to use for filling" to match array_fill()'s value description.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 10:00:01 2026 UTC