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

2013-01-12 Thread Levi Morrison
The real problem here (in my opinion) is that `array_filter` does not pass the key information to the callback. If you could do that, you could select columns that way. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

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

2013-01-12 Thread Nikita Popov
On Sat, Jan 12, 2013 at 6:57 AM, Stas Malyshev smalys...@sugarcrm.comwrote: Hi! Voting no, because - even though I like this feature in principle - I think it's much better solved by introducing list comprehensions (which cover this and many more cases in a consistent and elegant

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

2013-01-12 Thread Peter Cowburn
On 12 January 2013 00:17, Ben Ramsey ram...@php.net wrote: I've opened voting for the array_column() function RFC. You can vote at https://wiki.php.net/rfc/array_column#voting Regards, Ben The Status for this RFC is still Under discussion and on the RFC listing page it is the same. Is not

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

2013-01-12 Thread Derick Rethans
On Fri, 11 Jan 2013, 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'm liking this, why start with an function alias already when introducing a new feature? cheers, Derick -- PHP Internals - PHP

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

2013-01-12 Thread Derick Rethans
On Fri, 11 Jan 2013, Stas Malyshev wrote: Voting no, because - even though I like this feature in principle - I think it's much better solved by introducing list comprehensions (which cover this and many more cases in a consistent and elegant syntax), which is something I have planned for

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

2013-01-12 Thread Ben Ramsey
On 1/12/13 9:14 AM, Peter Cowburn wrote: The Status for this RFC is still Under discussion and on the RFC listing page it is the same. Is not changing those two things simply an oversight? It was an oversight. I have corrected it in both places. -- PHP Internals - PHP Runtime Development

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

2013-01-12 Thread Ben Ramsey
On 1/12/13 9:19 AM, Derick Rethans wrote: I'm liking this, why start with an function alias already when introducing a new feature? I figured this would be a frequent question, and I was right. :-) In earlier discussions (June 2012), when I first introduced array_column(), much of the

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

2013-01-12 Thread Derick Rethans
On Sat, 12 Jan 2013, Nikita Popov wrote: On Sat, Jan 12, 2013 at 6:57 AM, Stas Malyshev smalys...@sugarcrm.comwrote: This is a great illustration of different visions we have here. On one hand, we have practical, immediate feature that covers a clear use case and does not add any

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

2013-01-12 Thread Clint Priest
My .02 cents here... I'm used to array_pluck(), even when I first saw it I was like WTH is that? When you read the description though, 'plucking' is a verb which describes the action the function is taking, while column is a noun and does not describe the action the function is taking. In

Re: [PHP-DEV] A remark about PHP's Vision and new things.

2013-01-12 Thread guilhermebla...@gmail.com
Not really insane. PHPPHP is very powerful. Imagine someone that have no idea about C but would love to propose something. Just fork the project, add the desired support in PHP and propose here. I guarantee it'll be easier to understand the caveats and the final patch easily. Cheers, On Sat,

Re: [PHP-DEV] A remark about PHP's Vision and new things.

2013-01-12 Thread Anthony Ferrara
In a semi-joke but oddly real concept. I get that the language proposals (c++) are half jokes. But if we're going down that road, why don't we consider rpython and building on top of HippyVM that's already partially built... It would have a number of advantages over C: 1. It compiles to C, so

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

2013-01-12 Thread Thomas Hruska
On 1/11/2013 11:53 PM, Anthony Ferrara wrote: From what I can see this new function doesn't fit any of those three to a significant enough extent. All three are definitely subjective, but I'm leaning towards a no vote because I just don't feel there's enough justification for the new function

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

2013-01-12 Thread Peter Cowburn
On 12 January 2013 00:17, Ben Ramsey ram...@php.net wrote: I've opened voting for the array_column() function RFC. You can vote at https://wiki.php.net/rfc/array_column#voting I like the idea of this function, but have a few minor questions re. the current implementation. 1. Why is this

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

2013-01-12 Thread Levi Morrison
1. Why is this branch based on 5.3, rather than 5.4 or 5.5? Do you want this to be part of 5.3? The RFC (in particular the vote question) does not make it clear where/when you want this to be added. Please, this is not a bug or security fix. It does not belong in 5.3. -- PHP Internals - PHP

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

2013-01-12 Thread Nikita Popov
On Sat, Jan 12, 2013 at 4:54 PM, Derick Rethans der...@php.net wrote: I know that not everyone agrees with that philosophy, but I personally don't like to add new features that can be easily covered by more general solutions, or features that just represent a hack because the more general

[PHP-DEV] annotations, vision, goals

2013-01-12 Thread Rasmus Schultz
I hear a lot of interesting arguments in this big annotation discussion, and now there's the ongoing vision discussion, which got me thinking. It is true that there is broad community interest in annotations - part of the problem here, is that different groups have differing opinions about

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

2013-01-12 Thread Ben Ramsey
On 1/12/13 10:17 AM, Levi Morrison wrote: 1. Why is this branch based on 5.3, rather than 5.4 or 5.5? Do you want this to be part of 5.3? The RFC (in particular the vote question) does not make it clear where/when you want this to be added. Please, this is not a bug or security fix. It does

Re: [PHP-DEV] A remark about PHP's Vision and new things.

2013-01-12 Thread Yahav Gindi Bar
On Sat, Jan 12, 2013 at 7:35 AM, Levi Morrison morrison.l...@gmail.comwrote: Can we re-write PHP with PHP? ;) Anthony and Nikita are already on it: https://github.com/ircmaxell/PHPPHP -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

[PHP-DEV] array_map() function modification

2013-01-12 Thread Thomas Hruska
While we are on the general thought of arrays on this list, I was originally going to put in an idea for a new function and let it simmer for a while. Then I remembered that array_map() almost does what I want, but not quite. Someone can start a RFC if they like this idea. I thoroughly

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

2013-01-12 Thread Ben Ramsey
On 1/12/13 10:13 AM, Peter Cowburn wrote: 1. Why is this branch based on 5.3, rather than 5.4 or 5.5? Do you want this to be part of 5.3? The RFC (in particular the vote question) does not make it clear where/when you want this to be added. I mentioned this in another response on this thread.

Re: [PHP-DEV] array_map() function modification

2013-01-12 Thread Alexey Zakhlestin
On 12.01.2013, at 21:34, Thomas Hruska thru...@cubiclesoft.com wrote: This would allow developers to do things like: $keys = array('key1', 'key2', ..., 'keyn'); $vals = array('val1', 'val2', ..., 'valn'); $somemap = array_map($keys, $vals); Which would result in $somemap containing:

Re: [PHP-DEV] array_map() function modification

2013-01-12 Thread Clint Priest
On 1/12/2013 11:46 AM, Alexey Zakhlestin wrote: There is a function for this: http://docs.php.net/array_combine Nobody ever knows that one, I use it frequently, so useful. -- -Clint -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] annotations, vision, goals

2013-01-12 Thread Nikita Popov
On Sat, Jan 12, 2013 at 5:29 PM, Rasmus Schultz ras...@mindplay.dk wrote: I hear a lot of interesting arguments in this big annotation discussion, and now there's the ongoing vision discussion, which got me thinking. It is true that there is broad community interest in annotations - part of

Re: [PHP-DEV] array_map() function modification

2013-01-12 Thread Thomas Hruska
On 1/12/2013 10:46 AM, Alexey Zakhlestin wrote: On 12.01.2013, at 21:34, Thomas Hruska thru...@cubiclesoft.com wrote: This would allow developers to do things like: $keys = array('key1', 'key2', ..., 'keyn'); $vals = array('val1', 'val2', ..., 'valn'); $somemap = array_map($keys, $vals);

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

2013-01-12 Thread Lars Strojny
Hi Ben, Am 12.01.2013 um 01:17 schrieb Ben Ramsey ram...@php.net: I've opened voting for the array_column() function RFC. You can vote at https://wiki.php.net/rfc/array_column#voting I voted yes, but I prefer to call it just array_pluck (no aliases). It’s what underscore.js calls it and my

Re: [PHP-DEV] array_map() function modification

2013-01-12 Thread Galen Wright-Watson
On Sat, Jan 12, 2013 at 11:41 AM, Thomas Hruska thru...@cubiclesoft.comwrote: [...] The array_map() changes would allow for multiple arrays of values: array_map($keys, $vals, $vals2, $vals3); [...] But it would execute faster if it were supported in array_map(). If it is supported in

Re: [PHP-DEV] array_map() function modification

2013-01-12 Thread Pierre du Plessis
I'm not sure that adding this functionality in array_map would actually execute faster than doing array_combine($keys, array_map(null, $vals, $vals2, $vals3));. I will need to do some benchmarks to test, but I'm sure you will only see a performance improvement with extremely large arrays. Also

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

2013-01-12 Thread Matt Pelmear
Hi, On 01/12/2013 07:34 AM, Ben Ramsey wrote: 2) Developers coming from other languages (Ruby, JavaScript, etc.) will instantly recognize array_pluck(). It's what they'll be looking for to do the same thing, but they won't be looking for array_column(). -Ben When I have to write

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

2013-01-12 Thread Peter Cowburn
On 12 January 2013 16:41, Ben Ramsey ram...@php.net wrote: I must have misread the Git Workflow page of the wiki, which states: A patch will be applied to the oldest possible branch. If the Release Manager of 5.3 accepts the change, commit it to the 5.3 branch. We will use regular merging

Re: [PHP-DEV] array_map() function modification

2013-01-12 Thread Thomas Hruska
On 1/12/2013 1:10 PM, Peter Cowburn wrote: On 12 January 2013 20:06, Galen Wright-Watson ww.ga...@gmail.com wrote: Just to be clear, do you mean the result would be: array($keys[0] = array($vals0[0], $vals1[0], ...), $keys[1] = array($vals0[1], $vals1[1], ...), ...)

[PHP-DEV] VCS Account Request: cpriest

2013-01-12 Thread Clint Priest
Fix bugs, develop features and contribute to the core. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

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

2013-01-12 Thread Stas Malyshev
Hi! 2) Developers coming from other languages (Ruby, JavaScript, etc.) will instantly recognize array_pluck(). It's what they'll be looking for to do the same thing, but they won't be looking for array_column(). I say nuke the alias :) I like array_column (maybe because English is not my

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

2013-01-12 Thread Stas Malyshev
Hi! Stas, I think you are misrepresenting this a bit. It's not about adding something cool looking, it's about adding a feature that solves *this and many more* problems in a consistent way. A way that does *not* require to add a new function for every single array manipulation. We already

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

2013-01-12 Thread Stas Malyshev
Hi! I can submit a new pull request against the master branch, if that's acceptable. This is intended for 5.5. The patch should be against 5.5, I think. 5.5 is in alpha, so adding an isolated function to it is no problem (we're still considering adding a major language feature to it, so

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

2013-01-12 Thread Galen Wright-Watson
On Sat, Jan 12, 2013 at 7:34 AM, Ben Ramsey ram...@php.net wrote: On 1/12/13 9:19 AM, Derick Rethans wrote: I'm liking this, why start with an function alias already when introducing a new feature? I figured this would be a frequent question, and I was right. :-) In earlier discussions

Re: [PHP-DEV] annotations, vision, goals

2013-01-12 Thread Rasmus Schultz
I'm sorry, I guess I wasn't real clear on that - I've always known this feature as a source directive, guess I didn't know that's not really an established term. What I'm referring to is much simpler than what you suggested - it's just an equivalent to the source pre-processor directive in for