You are here: Re: [PHP] Re: [SPAM] - RE: [PHP] SPL Countable count() not being called - Bayesian Filter detected spam « PHP « IT news, forums, messages
Re: [PHP] Re: [SPAM] - RE: [PHP] SPL Countable count() not being called - Bayesian Filter detected spam

Posted by Chris on 10/17/07 11:25

Justin Francis wrote:

> Jay Blanchard wrote:
>
>> [snip]
>> No. By implementing the Countable interface, and implementing the
>> count() method, the global count($c) function is supposed to call
>> $c->count(). This is so the object can be treated like a countable array
>>
>> in the same manner.
>> [/snip]
>>
>> I was asleep earlier....if $c is not an array 1 will be returned. $c is
>> one number (200), not an array.
>>
>>
> This would be true if the class does not implement the Countable
> interface. It does, however, and so 1 should not be returned, but
> instead, whatever number is returned from the count() method of the
> Collection class. See the SPL documentation at www.php.net/spl for
> more on how this is supposed to work.
>
> - Justin
>
SPL is still teething apparently. The docs don't always match the
current functionality, and, I imagine, it can change from build to
build. I've recently had some bumpy rides trying to get Recursive
Iterators working the way I want.

I agree that it should work as you expect it to, and, in my opinion,
it's a bug. My opinion doesn't count for too much, but there it is.

Chris
--Thinking about implementing the Countable interface now....

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация