Re: [PHP-DEV] Re: [VOTE] array_column() function

2013-01-14 Thread Anthony Ferrara
Scott,

> I did review these, and I like them, but I think they should be added
> separately, especially since they deal more with objects than arrays.
>
> As long as the work with objects that implement ArrayAccess then it should
> be fine?
>

For consistency sake, I would recommend that it does not work with objects
(even that implement ArrayAccess). Right now, the array extension (the 76+
array functions) don't accept ArrayAccess classes, so this should be no
different IMHO...

Anthony


Re: [PHP-DEV] Re: [VOTE] array_column() function

2013-01-14 Thread Scott MacVicar
On 14 Jan 2013, at 12:57, Ben Ramsey  wrote:

> On 1/14/13 11:54 AM, Scott MacVicar wrote:
>> On 14 Jan 2013, at 11:37, Ben Ramsey  wrote:
>> 
>>> On 1/11/13 6:17 PM, Ben Ramsey wrote:
 I've opened voting for the array_column() function RFC.
 
 You can vote at https://wiki.php.net/rfc/array_column#voting
>>> 
>>> I have updated the pull request by removing the array_pluck() alias. I 
>>> favor the array_column() alias, as it is more in keeping with other 
>>> function names like array_keys() and array_values(), which do not have 
>>> verbs in them.
>>> 
>>> If the RFC is accepted, I will submit a new pull request against the 5.5 
>>> branch and close the current pull request against the 5.3 branch. If I 
>>> should do that now, please let me know, and I'll go ahead and take care of 
>>> it.
>> 
>> I've talked about the Facebook version of this when the key bit got added, 
>> but we have 2 other methods to go with it.
>> 
>> mpull() which does methods
>> https://github.com/facebook/libphutil/blob/master/src/utils/utils.php#L110
>> 
>> ppull() which does properties
>> https://github.com/facebook/libphutil/blob/master/src/utils/utils.php#L184
>> 
>> Not sure if these should be added separately? The property version is good 
>> for PDO when using FETCH_CLASS.
>> 
>> - S
>> 
> 
> I did review these, and I like them, but I think they should be added 
> separately, especially since they deal more with objects than arrays.

As long as the work with objects that implement ArrayAccess then it should be 
fine?

- S
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Re: [VOTE] array_column() function

2013-01-14 Thread Ben Ramsey

On 1/14/13 11:54 AM, Scott MacVicar wrote:

On 14 Jan 2013, at 11:37, Ben Ramsey  wrote:


On 1/11/13 6:17 PM, Ben Ramsey wrote:

I've opened voting for the array_column() function RFC.

You can vote at https://wiki.php.net/rfc/array_column#voting


I have updated the pull request by removing the array_pluck() alias. I favor 
the array_column() alias, as it is more in keeping with other function names 
like array_keys() and array_values(), which do not have verbs in them.

If the RFC is accepted, I will submit a new pull request against the 5.5 branch 
and close the current pull request against the 5.3 branch. If I should do that 
now, please let me know, and I'll go ahead and take care of it.


I've talked about the Facebook version of this when the key bit got added, but 
we have 2 other methods to go with it.

mpull() which does methods
https://github.com/facebook/libphutil/blob/master/src/utils/utils.php#L110

ppull() which does properties
https://github.com/facebook/libphutil/blob/master/src/utils/utils.php#L184

Not sure if these should be added separately? The property version is good for 
PDO when using FETCH_CLASS.

- S



I did review these, and I like them, but I think they should be added 
separately, especially since they deal more with objects than arrays.


-Ben

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Re: [VOTE] array_column() function

2013-01-14 Thread Scott MacVicar
On 14 Jan 2013, at 11:37, Ben Ramsey  wrote:

> On 1/11/13 6:17 PM, Ben Ramsey wrote:
>> I've opened voting for the array_column() function RFC.
>> 
>> You can vote at https://wiki.php.net/rfc/array_column#voting
> 
> I have updated the pull request by removing the array_pluck() alias. I favor 
> the array_column() alias, as it is more in keeping with other function names 
> like array_keys() and array_values(), which do not have verbs in them.
> 
> If the RFC is accepted, I will submit a new pull request against the 5.5 
> branch and close the current pull request against the 5.3 branch. If I should 
> do that now, please let me know, and I'll go ahead and take care of it.

I've talked about the Facebook version of this when the key bit got added, but 
we have 2 other methods to go with it.

mpull() which does methods
https://github.com/facebook/libphutil/blob/master/src/utils/utils.php#L110

ppull() which does properties
https://github.com/facebook/libphutil/blob/master/src/utils/utils.php#L184

Not sure if these should be added separately? The property version is good for 
PDO when using FETCH_CLASS.

- S
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: [VOTE] array_column() function

2013-01-14 Thread Ben Ramsey

On 1/11/13 6:17 PM, Ben Ramsey wrote:

I've opened voting for the array_column() function RFC.

You can vote at https://wiki.php.net/rfc/array_column#voting


I have updated the pull request by removing the array_pluck() alias. I 
favor the array_column() alias, as it is more in keeping with other 
function names like array_keys() and array_values(), which do not have 
verbs in them.


If the RFC is accepted, I will submit a new pull request against the 5.5 
branch and close the current pull request against the 5.3 branch. If I 
should do that now, please let me know, and I'll go ahead and take care 
of it.


Thanks,
Ben

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php