php/php-src — pull request #331 by ramsey (2013-04-22 17:21:46+00:00)
Title: Functionality updates to array_column()

This pull request updates the `array_column()` function to support the following new functionality:

* Maintain original index association if no third parameter
* Second param should be optional to use entire rows as result
* Support array of column names for second parameter

This has been discussed on the #php.pecl IRC channel, and others agreed that these are good additions that can be added as this time, while 5.5 is still in beta. Once 5.5 moves to RC or GA, these features would present possible BC breaks to the `array_column()` functionality and should not be added.

Here are more detailed descriptions of the additional functionality:

### Maintain original index association if no third parameter

If no third parameter is passed, the resulting array maintains the indexes passed in from the original array. Feature suggested by David Zülke.

### Second param should be optional to use entire rows as result

When NULL is passed as the second parameter, all columns from the input array are returned. See https://bugs.php.net/bug.php?id=64493

### Support array of column names for second parameter

If the second parameter is an array of column names, each row returned in the result array is an array containing only the specified columns. The rows are indexed by the third parameter. Feature inspired by suggestions from Hakre and Craig Campbell. See https://github.com/php/php-src/pull/257#issuecomment-12594630