Incorrect description of function array_map()?
Peter Hunkeler <[email protected]>
| Newsgroups | gmane.comp.php.documentation.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, I wonder whether the documentation of the array_map() function is correct? The documentation describes arrays as being "ordered maps that associates values to keys". The "key" is what is called "index" in other languages. The PHP doc mostly uses the word "key", and less often the word "index". I further read in the doc of "array_map()" that "array_map() returns an array containing the results of applying the callback to the corresponding index of array (and arrays if more arrays are provided) used as arguments for the callback." But the function applies the callback to each "value" of the array, not the "keys", right? Shouldn't the doc say "... applying the callback to the corresponding values of array..."? -- Cheers, Peter