Re: [PHP-DEV] Supporting ArrayObject in array_* functions

2009-07-30 Thread David Coallier
What do you think about the possibility to support ArrayObject instances in array_* functions? If you all agreed on this, I can definately help to complete the patch, but I need some initial guidance to finish at least the first function. I think it's a marvelous idea :) I'm attaching

Re: [PHP-DEV] Supporting ArrayObject in array_* functions

2009-07-30 Thread Lewis Wright
2009/7/30 David Coallier dav...@php.net What do you think about the possibility to support ArrayObject instances in array_* functions? If you all agreed on this, I can definately help to complete the patch, but I need some initial guidance to finish at least the first function. I

Re: [PHP-DEV] Supporting ArrayObject in array_* functions

2009-07-30 Thread Johannes Schlüter
On Thu, 2009-07-30 at 00:08 -0300, Guilherme Blanco wrote: What do you think about the possibility to support ArrayObject instances in array_* functions? If you all agreed on this, I can definately help to complete the patch, but I need some initial guidance to finish at least the first

Re: [PHP-DEV] Supporting ArrayObject in array_* functions

2009-07-30 Thread Alexey Zakhlestin
2009/7/30 Johannes Schlüter johan...@schlueters.de: On Thu, 2009-07-30 at 00:08 -0300, Guilherme Blanco wrote: What do you think about the possibility to support ArrayObject instances in array_* functions? If you all agreed on this, I can definately help to complete the patch, but I need some

Re: [PHP-DEV] Supporting ArrayObject in array_* functions

2009-07-30 Thread Guilherme Blanco
I'm trying to avoid a globally solution on first instance to avoid a great impact on language. If you wanna ask me what's the global solution, I'll suggest a Collection like implementation for all array functions. http://en.wikipedia.org/wiki/Collection_%28computing%29

Re: [PHP-DEV] Supporting ArrayObject in array_* functions

2009-07-30 Thread Nate Gordon
2009/7/30 Alexey Zakhlestin indey...@gmail.com 2009/7/30 Johannes Schlüter johan...@schlueters.de: On Thu, 2009-07-30 at 00:08 -0300, Guilherme Blanco wrote: What do you think about the possibility to support ArrayObject instances in array_* functions? If you all agreed on this, I can

Re: [PHP-DEV] Supporting ArrayObject in array_* functions

2009-07-30 Thread Johannes Schlüter
On Thu, 2009-07-30 at 11:42 -0300, Guilherme Blanco wrote: I'm trying to avoid a globally solution on first instance to avoid a great impact on language. If you wanna ask me what's the global solution, I'll suggest a Collection like implementation for all array functions. Define all array

Re: [PHP-DEV] Supporting ArrayObject in array_* functions

2009-07-30 Thread Guilherme Blanco
Until now I tried to find the easiest possible solution. Currently we have two paths to chose: 1- A class that implements ArrayAccess must be useable everywhere an array is useable; 2- ArrayAccess needs to be expanded with methods for all the array functions and ArrayObject needs to implement

Re: [PHP-DEV] Supporting ArrayObject in array_* functions

2009-07-30 Thread Roman Borschel
Hi, I like this idea very much, too but I do see the problems in doing it correctly. From my point of view the problem looks as follows: PHP arrays are a wonderful universal construct but it is problematic to use them in scenarios where you dont want to bind directly to the single,

Re: [PHP-DEV] Supporting ArrayObject in array_* functions

2009-07-30 Thread Stanislav Malyshev
Hi! 1- A class that implements ArrayAccess must be useable everywhere an array is useable; The problem is that many functions dealing with arrays do not make sense with generic object. For others, it may make sense in theory, but not be practical - e.g., suppose you have ArrayAccess object

Re: [PHP-DEV] Supporting ArrayObject in array_* functions

2009-07-30 Thread Guilherme Blanco
Hi Stan, I don't really know which implementation is preferrable. I just dropped the idea here first. Once decided, I can write a detailed RFC. With some initial help, I can work on the patch to support it. I'm not expert in internals, so some help will be surely needed. I'm totally opened to