[PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-21 Thread Ben Ramsey
Hi all, I've written a draft version of an RFC for pull request 56 ( https://github.com/php/php-src/pull/56 ), to add array_column() to the core. Please take a look and provide feedback so that I can improve the patch/proposal. https://wiki.php.net/rfc/array_column Thanks, Ben -- PHP Inter

Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-21 Thread Paul Dragoonis
On Thu, Jun 21, 2012 at 8:27 PM, Ben Ramsey wrote: > Hi all, > > I've written a draft version of an RFC for pull request 56 ( > https://github.com/php/php-src/pull/56 ), to add array_column() to the core. > Please take a look and provide feedback so that I can improve the > patch/proposal. > > htt

Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-22 Thread Léo Peltier
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). -- Léo Peltier -- PHP Internals - PHP Runtime Development Mailin

Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-22 Thread Ben Ramsey
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 alia

Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-22 Thread Anatoliy Belsky
Hi Ben, I've tested your patch on Windows, it compiles and the tests pass. All the best with that :) Regards Anatoliy Am Fr, 22.06.2012, 17:52 schrieb Ben Ramsey: > 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

Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-22 Thread Tom Sartain
On Fri, Jun 22, 2012 at 11:52 AM, 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 >>

Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-22 Thread Scott MacVicar
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 >>

Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-22 Thread Larry Garfield
On 06/22/2012 04:20 PM, Scott MacVicar wrote: 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 Goog

Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-23 Thread Stas Malyshev
Hi! > I'm open to changing or aliasing the name to array_pluck(), if others > are in agreement. I wouldn't know what "pluck" means here. "Column" is a clear word with established meaning. Let's not get too whimsical here. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.c

Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-24 Thread Ralph Schindler
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. Actually, while perhaps most of the time a value from a column is what people retrieving from a da

Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-25 Thread Matthew Weier O'Phinney
On 2012-06-23, Stas Malyshev wrote: > > I'm open to changing or aliasing the name to array_pluck(), if others > > are in agreement. > > I wouldn't know what "pluck" means here. "Column" is a clear word with > established meaning. Let's not get too whimsical here. Nothing whimsical about it at al

Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-25 Thread Ben Ramsey
On 6/25/12 9:44 AM, Matthew Weier O'Phinney wrote: On 2012-06-23, Stas Malyshev wrote: I'm open to changing or aliasing the name to array_pluck(), if others are in agreement. I wouldn't know what "pluck" means here. "Column" is a clear word with established meaning. Let's not get too whimsica

Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-25 Thread Aaron Holmes
For what my .02 is worth, I imagine "plucking" an item out of an array would not occur to a user-land developer as the proper nomenclature for extracting all the values from an array with the given key. At worst, this means many developers simply won't learn about the function and continue to i

Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-25 Thread Paul Dragoonis
What about array_extract ? On Mon, Jun 25, 2012 at 9:31 PM, Aaron Holmes wrote: > For what my .02 is worth, I imagine "plucking" an item out of an array > would not occur to a user-land developer as the proper nomenclature for > extracting all the values from an array with the given key. At wors

Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-25 Thread Aaron Holmes
The name makes sense, but would likely be confused with extract() http://us3.php.net/extract On 6/25/2012 5:35 PM, Paul Dragoonis wrote: What about array_extract ? On Mon, Jun 25, 2012 at 9:31 PM, Aaron Holmes > wrote: For what my .02 is worth, I imagine "pl

Re: Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-25 Thread Morgan L. Owens
On 2012-06-25 04:19, Ralph Schindler wrote: 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. In the case of this addition, I do indeed like array_p

RE: Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-26 Thread Ford, Mike
> -Original Message- > From: Morgan L. Owens [mailto:pack...@nznet.gen.nz] > Sent: 25 June 2012 15:41 > > On 2012-06-25 04:19, Ralph Schindler wrote: > >> 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

Re: Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-27 Thread Morgan L. Owens
On 2012-06-26 07:22, Ben Ramsey wrote: However, in Prototype.js and Underscore.js, pluck seems behave more like array_map() in PHP: http://api.prototypejs.org/language/Enumerable/prototype/pluck/ http://documentcloud.github.com/underscore/#pluck Nevertheless, it would technically have the same