Re: [DRAFT] RFC - array_column() function
| From: | Tom Sartain | Date: | Fri, 22 Jun 2012 20:59:38 +0000 |
| Subject: | Re: [DRAFT] RFC - array_column() function | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60942@lists.php.net to get a copy of this message | ||
On Fri, Jun 22, 2012 at 11:52 AM, Ben Ramsey <ramsey@php.net> wrote:
> On 6/22/12 5:32 AM, Léo Peltier wrote:
>
>> Hi,
>>
>> Shouldn't this be called 'array_pluck'?
>> This is the name people usually use when implementing it in PHP (see
>> "array_pluck(" vs "array_column(" in Google) or in other languages/libs
>> (see underscorejs, prototypejs and RoR).
>>
>>
> I'm open to changing or aliasing the name to array_pluck(), if others are
> in agreement.
+1 on using array_pluck.
The term 'column' makes a lot of sense for PDO working with database
columns, but there is no concept of a 'column' in the array structure or
PHP as a whole, outside of database related functions.
- Tom Sartain