Re: [PHP-DEV] Proposal: array_flatten function

2008-12-27 Thread Kevin Waterson
This one time, at band camp, Brian Moon wrote: > I would agree except that doing lots of work on arrays in user space > consumes a lot of memory because of the number of opcodes used when > working on removing/adding things to the array. This is exactly the scenario for which SPL Iterators wer

Re: [PHP-DEV] Proposal: array_flatten function

2008-12-27 Thread Brian Moon
On 12/27/08 2:10 AM, Kevin Waterson wrote: The last thing that is needed, is more array functions.. I would agree except that doing lots of work on arrays in user space consumes a lot of memory because of the number of opcodes used when working on removing/adding things to the array. We cre

Re: [PHP-DEV] Proposal: array_flatten function

2008-12-27 Thread Kevin Waterson
This one time, at band camp, "Mike Panchenko" wrote: > Why not just link straight to the tutorial on your site? ;) Not sure what > your point is, other than "there's a way to do this in userland," which I > cover in my email. Maybe some sentences to accompany it would make it easier > to understa

Re: [PHP-DEV] Proposal: array_flatten function

2008-12-26 Thread Mike Panchenko
Lukas, Hmmm I'm just trying to solve the basic problem (hence my skepticism towards preserving keys - it seems an edge case). I think once you get to more specific requirements, iterators are probably the way to go, since all the standard functions you could use to shorten this would re-iterate ov

Re: [PHP-DEV] Proposal: array_flatten function

2008-12-26 Thread Mike Panchenko
Why not just link straight to the tutorial on your site? ;) Not sure what your point is, other than "there's a way to do this in userland," which I cover in my email. Maybe some sentences to accompany it would make it easier to understand. Thanks for reading. Cheers. Mike. On Fri, Dec 26, 2008 a

Re: [PHP-DEV] Proposal: array_flatten function

2008-12-26 Thread Lukas Kahwe Smith
On 26.12.2008, at 10:06, Mike Panchenko wrote: Hey everybody, I'm new both to the list and to hacking the internals, so I'll try to keep it short and humble. I've written an array_flatten function which just takes all elements from a nested array and pushes them into a single indexed arra

Re: [PHP-DEV] Proposal: array_flatten function

2008-12-26 Thread Kevin Waterson
This one time, at band camp, "Mike Panchenko" wrote: > Hey everybody, I'm new both to the list and to hacking the internals, so > I'll try to keep it short and humble. > > I've written an array_flatten function which just takes all elements from a > nested array and pushes them into a single ind

Re: [PHP-DEV] Proposal: array_flatten function

2008-12-26 Thread Mike Panchenko
Well, I've made a patch against 5.3 for now, let me know if there are issues with it (I'm sure there are) and if you want the HEAD patch. Cheers. Mike. On Fri, Dec 26, 2008 at 2:55 AM, Alexey Zakhlestin wrote: > On Fri, Dec 26, 2008 at 1:43 PM, David Coallier wrote: > >> > >> "cvs diff -u" agai

Re: [PHP-DEV] Proposal: array_flatten function

2008-12-26 Thread Alexey Zakhlestin
On Fri, Dec 26, 2008 at 1:43 PM, David Coallier wrote: >> >> "cvs diff -u" against 5.3 branch shoould be ok for the start. >> after positive review, "cvs diff -u" against HEAD would be needed to >> > > I really have to say it, you should make your changes to HEAD > __first__ then to 5.3. Not the o

Re: [PHP-DEV] Proposal: array_flatten function

2008-12-26 Thread David Coallier
> > "cvs diff -u" against 5.3 branch shoould be ok for the start. > after positive review, "cvs diff -u" against HEAD would be needed to > I really have to say it, you should make your changes to HEAD __first__ then to 5.3. Not the other way around :) -- Slan, David -- PHP Internals - PHP Runt

Re: [PHP-DEV] Proposal: array_flatten function

2008-12-26 Thread Alexey Zakhlestin
On Fri, Dec 26, 2008 at 12:06 PM, Mike Panchenko wrote: > Hey everybody, I'm new both to the list and to hacking the internals, so > I'll try to keep it short and humble. > > I've written an array_flatten function which just takes all elements from a > nested array and pushes them into a single in

[PHP-DEV] Proposal: array_flatten function

2008-12-26 Thread Mike Panchenko
Hey everybody, I'm new both to the list and to hacking the internals, so I'll try to keep it short and humble. I've written an array_flatten function which just takes all elements from a nested array and pushes them into a single indexed array. Couple of questions: 1. Most importantly, is this p