Re: Re: cvs: php-src /ext/standard array.c
| From: | Marcus Boerger | Date: | Sat, 20 Nov 2004 01:36:31 +0000 |
| Subject: | Re: Re: cvs: php-src /ext/standard array.c | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-13894@lists.php.net to get a copy of this message | ||
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 which are array wrappers and thus they
>>should work in count() as expected.
> I don't completely agree because I can probably find many other places
> where this could theoretically have to work. So I'm not quite sure why
> count() is special (maybe because it's the most straightforward example). I
> mean it's not the end of the world but these kind of things tend to start
> at "let's just get count() to work" and then there are incremental patches
> to put PHP upside down to fix other places.
> You never answered about the naming convention? I think in any case, it
> should be using the standard naming convention for such reserved function,
> as in __count().
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
the name of course.
Best regards,
Marcus mailto:helly@php.net