Andi Gutmans wrote:
Just to clarify, this is only for internal classes like Exception, right? Userland __toString() will continue to be invoked when an explicit (string) cast (or concat, etc.) is used, correct?
Wrong. The only time userland __toString() will be invoked will be in print/eval. We found that all the places where this happened automaticall were buggy due to the way our opcode mechanism works. It's not a quick fix to support this and is not something I would like to do before 5.0.0. You're going to have to explicitly call __toString() in anything except for print/eval.
Ugh ... that really sucks. I understand there's a good reason & don't understand the internals, but I would say that as a user being able to work transparently with objects or strings (i.e. the behavior in b2-b4) was *extremely* nice.
Anyway, thanks for clarification.
Hans
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php