[PHP] Re: SPL Countable count() not being called

2005-08-31 Thread Justin Francis

Justin Francis wrote:

I have not been able to get count() to be called when I pass my 
Countable class to the count function. I am using PHP 5.1 Release 
Candidate 1. I am not sure if it is a bug, so I am posting here to see 
if anyone can help.

--
class Collection implements Countable
{
 public function count()
 {
   return 200;
 }   }

$c = new Collection();
echo(count($c));

This code prints 1 out with no errors, when it should print out 200.

Any ideas?

In case anyone was wondering, I downloaded the latest cvs snapshot, and 
this bug has been fixed.


Justin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: SPL Countable count() not being called

2005-08-31 Thread Jay Blanchard
[snip]
 
 This code prints 1 out with no errors, when it should print out 200.

 Any ideas?

In case anyone was wondering, I downloaded the latest cvs snapshot, and 
this bug has been fixed.
[/snip]

Bug? There is no bug. You counted 1 (one) item, not 200.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php