You are here: SPL Countable count() not being called « PHP « IT news, forums, messages
SPL Countable count() not being called

Posted by Justin Francis on 10/09/95 11:25

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?

 

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

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