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
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 earlierif $c
[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 earlierif $c is not an array 1 will be
Justin Francis wrote:
Stut wrote:
Should it not be $c->count() ?
-Stut
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
Stut wrote:
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 Col
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 implem
[snip]
class Collection implements Countable
{
public function count()
{
return 200;
}
}
$c = new Collection();
echo(count($c));
[/snip]
Shouldn't this be
echo Collection->count($c);
or something like that?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
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
8 matches
Mail list logo