I've just submitted the following pull request for updates to the
array_column() function:
https://github.com/php/php-src/pull/331
I asked about these changes on the #php.pecl IRC channel a few weeks
ago, and others on the channel agreed that it was best to go ahead and
submit these changes while PHP 5.5 is still in beta, since these would
potentially create BC breaks once 5.5 is in RC or GA stages.
I'm not certain of the proper process for handling these changes,
though. Do I need to update the RFC to account for these changes? Would
I then need to call for another vote?
The changes are detailed on the PR, but I'm reproducing that description
here, for the sake of discussion:
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
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/issues/257#issuecomment-12594630
Thanks,
Ben
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php