On Sat, 3 Jun 2006, Marcus Boerger wrote:

> Hello Robert,
> 
>   well lazy is a good point here but __toString is all about lazyness.
> Then again as said you might want to have objects naturally convert
> to strings whereever possible. Generally when providing a __toString
> implementation you say that you want this. And then you might as well
> expect that your objects can be used as index to arrays.
> 
> The example is as said an object that can be used to calculate the
> index to an array. Assuming you deal with persons derived from
> a database as classes, your person objects might be implmeneted so
> that __toString simply returns the name of the persons. Now when your
> application also has an array that stores more information about the
> persons it would be nice if you could access that array direectly by
> your peson objects.

Makes sense to me, so +1.

Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to