Re: Re: cvs: php-src /ext/standard array.c
| From: | Andi Gutmans | Date: | Sat, 20 Nov 2004 00:02:05 +0000 |
| Subject: | Re: Re: cvs: php-src /ext/standard array.c | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-13893@lists.php.net to get a copy of this message | ||
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(). Andi