[PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2009-02-25 Thread Moriyoshi Koizumi
Last call: any more objections? Moriyoshi On Thu, Feb 19, 2009 at 11:52 AM, Moriyoshi Koizumi wrote: > On Thu, Feb 19, 2009 at 4:51 AM, Andrei Zmievski > wrote: >> Moriyoshi Koizumi wrote: >>> >>> As I said earlier, the function is never supposed to be used with >>> objects. Therefore, we cann

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2009-02-18 Thread Moriyoshi Koizumi
On Thu, Feb 19, 2009 at 3:14 PM, Ian Eure wrote: > On Feb 18, 2009, at 6:52 PM, Moriyoshi Koizumi wrote: > >> On Thu, Feb 19, 2009 at 4:51 AM, Andrei Zmievski >> wrote: >>> >>> Moriyoshi Koizumi wrote: As I said earlier, the function is never supposed to be used with objects. There

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2009-02-18 Thread Ian Eure
On Feb 18, 2009, at 6:52 PM, Moriyoshi Koizumi wrote: On Thu, Feb 19, 2009 at 4:51 AM, Andrei Zmievski > wrote: Moriyoshi Koizumi wrote: As I said earlier, the function is never supposed to be used with objects. Therefore, we cannot declare it to be broken, and any change to the behavior an

[PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2009-02-18 Thread Moriyoshi Koizumi
On Thu, Feb 19, 2009 at 4:51 AM, Andrei Zmievski wrote: > Moriyoshi Koizumi wrote: >> >> As I said earlier, the function is never supposed to be used with >> objects. Therefore, we cannot declare it to be broken, and any change >> to the behavior anyway leads to a huge BC break. I got a report tha

[PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2009-02-18 Thread Andrei Zmievski
Yes, those should be fixed too, but it's more difficult to do because they accept varargs, so not clear where the flag should go. -Andrei Moriyoshi Koizumi wrote: In addition, we should look at similar comparison-involved array functions such as array_intersect, array_diff and so on, otherwise

[PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2009-02-18 Thread Andrei Zmievski
Moriyoshi Koizumi wrote: As I said earlier, the function is never supposed to be used with objects. Therefore, we cannot declare it to be broken, and any change to the behavior anyway leads to a huge BC break. I got a report that claims the reporter's real-world application behaves strangely with

[PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2009-02-17 Thread Moriyoshi Koizumi
In addition, we should look at similar comparison-involved array functions such as array_intersect, array_diff and so on, otherwise it's gonna be a mess. Moriyoshi On Wed, Feb 18, 2009 at 11:43 AM, Moriyoshi Koizumi wrote: > On Wed, Feb 18, 2009 at 3:11 AM, Andrei Zmievski > wrote: > >> SORT_S

[PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2009-02-17 Thread Moriyoshi Koizumi
On Wed, Feb 18, 2009 at 3:11 AM, Andrei Zmievski wrote: > SORT_STRING can only reliably deal with strings - its behavior on non-string > type is basically broken. Unless we agree that PHP is Tcl (strings are the > only type), then SORT_REGULAR makes much more sense to me, and evidently > others.

[PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2009-02-17 Thread Andrei Zmievski
Moriyoshi Koizumi wrote: Ilia Alshanetsky wrote: I've discussed this issue with Andrei at least a month ago (if not longer) when the patch was originally added, and I believe that the introduced behavior is the correct one. IMO correct or not depends on the context where the function is used.

[PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2009-02-17 Thread Moriyoshi Koizumi
Anyone's thoughts on this? I'm thinking of re-reverting in 48 hours without further objections. Moriyoshi On Sun, Feb 15, 2009 at 11:48 PM, Moriyoshi Koizumi wrote: > Ilia Alshanetsky wrote: >> I've discussed this issue with Andrei at least a month ago (if not >> longer) when the patch was orig

[PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2009-02-15 Thread Moriyoshi Koizumi
Ilia Alshanetsky wrote: > I've discussed this issue with Andrei at least a month ago (if not > longer) when the patch was originally added, and I believe that the > introduced behavior is the correct one. IMO correct or not depends on the context where the function is used. At least, as array_uni

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-22 Thread Andi Gutmans
I understand the illusion part. With foreach() I can see the gain and how it improves readability and the code. But with count() I just don't see it. Maybe because the foreach() alternative is not only $obj->foreach() but something much uglier :) So yeah, I think there's quite a substantial dif

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-22 Thread Christian Schneider
Andi Gutmans wrote: Why can't people who implement the Countable interface use $obj->count() instead of count($obj)? I guess the idea of SPL is hide the difference between real arrays and some homebrewed containers. The question is how much you want to maintain this illusion, i.e. what operation

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-22 Thread Andi Gutmans
I guess I'm missing something basic. Why can't people who implement the Countable interface use $obj->count() instead of count($obj)? I just don't see any reason to overload count() in this scenario. It does set a precendent to overload all of array.c and as I mention, there is no reason why cou

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-20 Thread Marcus Boerger
Hello Andrey, Saturday, November 20, 2004, 5:49:46 PM, you wrote: > Marcus Boerger wrote: >> Hello Christian, >> > ... >> - __serialize(), __unserialize() controlled by a provided implementation >> and handled by ext/standard > ... >> >> Best regards, >> Marcusmai

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-20 Thread Andrey Hristov
Marcus Boerger wrote: Hello Christian, ... - __serialize(), __unserialize() controlled by a provided implementation and handled by ext/standard ... Best regards, Marcusmailto:[EMAIL PROTECTED] You mean __sleep() and __wakeup() or? Thanks, Andrey -- PHP Internals - PH

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-20 Thread Christian Schneider
Marcus Boerger wrote: Mabe you should look here at the engine description in Zend directory of you PHP source. Ok, thanks for you summary. I read that and had a look at ZEND_CHANGES. - [] is overloaded by interface ArrayAccess (this is engine level only count() is missing here) - count() is overl

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-20 Thread Marcus Boerger
Hello Christian, Saturday, November 20, 2004, 2:59:07 PM, you wrote: > Marcus Boerger wrote: >> We already decided not to allow ArrayAccess implementations to work > Ok, excuse my ignorance, so what's the list of functions/constructs > affected by SPL? > - foreach > - [] > - count() > What el

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-20 Thread Christian Schneider
Marcus Boerger wrote: We already decided not to allow ArrayAccess implementations to work Ok, excuse my ignorance, so what's the list of functions/constructs affected by SPL? - foreach - [] - count() What else? Are there plan to extend that at a later stage? [ Simply point me to an online docume

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-20 Thread Marcus Boerger
Hello Dirkjan, Saturday, November 20, 2004, 1:01:22 PM, you wrote: > If it works in count(), will it work in sizeof() as well? See: http://php.net/sizeof Best regards, Marcusmailto:[EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubs

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-20 Thread Marcus Boerger
Hello Christian, Saturday, November 20, 2004, 11:47:01 AM, you wrote: > Marcus Boerger wrote: >> We don't do this for any other interface based 'magic' (iterators, array >> overloading). But if that's your only concern then i'll happily change > I think the keyword here is 'magic'. This introduc

[PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-20 Thread Dirkjan Ochtman
If it works in count(), will it work in sizeof() as well? Regards, Manuzhai -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-20 Thread Christian Schneider
Marcus Boerger wrote: We don't do this for any other interface based 'magic' (iterators, array overloading). But if that's your only concern then i'll happily change I think the keyword here is 'magic'. This introduces another mechanism for overloaded behaviour. Something can now a) implement an

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-19 Thread Marcus Boerger
Hello Andi, Saturday, November 20, 2004, 1:02:05 AM, you wrote: > At 10:26 AM 11/19/2004 +0100, Marcus Boerger wrote: >>You simply implement the interface countable and then your objects can be >>put into count() to get the count function called. This is very helpful >>with ArrayObject/ArrayItera

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-19 Thread Andi Gutmans
At 10:26 AM 11/19/2004 +0100, Marcus Boerger wrote: You simply implement the interface countable and then your objects can be put into count() to get the count function called. This is very helpful with ArrayObject/ArrayIterator which are array wrappers and thus they should work in count() as expec

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-19 Thread Marcus Boerger
Hello Andi, Friday, November 19, 2004, 12:09:12 AM, you wrote: > At 08:55 AM 11/17/2004 +0100, Marcus Boerger wrote: >>Hello Andi, >> >>Tuesday, November 16, 2004, 11:56:48 PM, you wrote: >> >> > Marcus, >> >> > I didn't see discussion about this. How much is such a countable interface >> > reall

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-18 Thread Andi Gutmans
At 08:55 AM 11/17/2004 +0100, Marcus Boerger wrote: Hello Andi, Tuesday, November 16, 2004, 11:56:48 PM, you wrote: > Marcus, > I didn't see discussion about this. How much is such a countable interface > really needed? Is this only for SPL or is this supposed to be general > purpose. I would prefe

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-17 Thread Marcus Boerger
Hello l0t3k, Wednesday, November 17, 2004, 2:08:26 PM, you wrote: > Since we're kinda on the topic, i'd like to raise the issue of the status of > SPL. i.e. will it be bundled standard ? i'm asking because alot of the work > that was done in SPL should IMHO be core (e.g. the base exception classe

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-17 Thread l0t3k
Since we're kinda on the topic, i'd like to raise the issue of the status of SPL. i.e. will it be bundled standard ? i'm asking because alot of the work that was done in SPL should IMHO be core (e.g. the base exception classes). i'm wrapping a semi-large framework and i'd prefer not to redefine tho

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-16 Thread Marcus Boerger
Hello Andi, Tuesday, November 16, 2004, 11:56:48 PM, you wrote: > Marcus, > I didn't see discussion about this. How much is such a countable interface > really needed? Is this only for SPL or is this supposed to be general > purpose. I would prefer to only see it in SPL but I see you made some

[PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c

2004-11-16 Thread Andi Gutmans
Marcus, I didn't see discussion about this. How much is such a countable interface really needed? Is this only for SPL or is this supposed to be general purpose. I would prefer to only see it in SPL but I see you made some changes to array.c. This might lead to inconsistency with the rest of PHP

[PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard array.c basic_functions.c php_array.h

2003-09-24 Thread Andrey Hristov
Wez Furlong wrote: > Should these functions really go into the core? > Perhaps they are better off in an extension (pecl/array_utils ?) > > The names aren't really all that obvious to me either. > > --Wez. Hi Wez, well maybe array_udiff_uassoc() and array_diff_uassoc() are of little need but I add