Guys,

We have had this discussion before. There are two extremes to this issue. The first is to always require the explicit __toString() call and the second is to never require it and have all places in PHP whether it's str_replace(), (string)$obj, $arr[$obj] to automatically convert to string. The latter is problematic because it propagates to far too many places and causes too much magic in my opinion.
I think the right trade off is to automatically convert it with "print" and with concatenation. All the rest will require explicit calling.
It might not be your dream but it's a realistic approach.


Andi

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



Reply via email to