Re: Incorrect description of function array_map()?

From: Date: Wed, 02 Mar 2022 13:00:37 +0000
Subject: Re: Incorrect description of function array_map()?
References: 1 2  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969388084@lists.php.net to get a copy of this message
Thanks. I'll report on github next time. -- Peter Am 02.03.2022 um 13:24 schrieb Christoph M. Becker:
On 01.03.2022 at 22:07, Peter Hunkeler wrote:
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..."?
Thanks! Fixed as <https://github.com/php/doc-en/commit/e8c83816e0ca7a4136a5991b2227ddf00fa9adc6>. Please report documentation bugs at <https://github.com/php/doc-en/issues> next time. :) -- Christoph M. Becker


« previous php.doc (#969388084) next »