[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 m...@mozo.jp wrote: On Thu, Feb 19, 2009 at 4:51 AM, Andrei Zmievski and...@gravitonic.com wrote: Moriyoshi Koizumi wrote: As I said earlier, the function is never supposed to be used with

[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

[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,

[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 and...@gravitonic.com 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

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 and...@gravitonic.com 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

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 i...@digg.com wrote: On Feb 18, 2009, at 6:52 PM, Moriyoshi Koizumi wrote: On Thu, Feb 19, 2009 at 4:51 AM, Andrei Zmievski and...@gravitonic.com wrote: Moriyoshi Koizumi wrote: As I said earlier, the function is never supposed to be used with

[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
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 m...@mozo.jp wrote: On Wed, Feb 18, 2009 at 3:11 AM, Andrei Zmievski

[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

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

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

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

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

[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 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 introduces

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

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

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 else? Are

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

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 -

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, Marcusmailto:[EMAIL

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 really needed? Is this

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

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/ArrayIterator

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 prefer

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

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

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