Hey Ben,
On 22 Jun 2012, at 08:52, Ben Ramsey 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.
We have a version of this at Facebook and its called array_pull() it has a
third parameter and supports pulling a new key value too. You can find a copy
of it in Phabricator. There is also mpull() which is for methods. I'd recommend
combining the two methods to be honest and doing a single function that
supports index names or a method.
https://github.com/facebook/libphutil/blob/master/src/utils/utils.php#L143
- S
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php