Re: __toString()

php.internals

Andi Gutmans

22 years ago
It is supported by "print" and for internal extensions such as SimpleXML which require this. Also in Java toString() isn't called automagically in every place so I wouldn't call it useless. Andi At 08:56 AM 12/14/2003 +0100, Sebastian Bergmann wrote:

Sebastian Bergmann

22 years ago
Andi Gutmans wrote:
> It is supported by "print" and for internal extensions such as > SimpleXML which require this.
How is it supported by "print" when print $defect->thrownException() does not work but the object returned from thrownException() has a __toString() method?
-- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/

Cristiano Duarte

22 years ago
Em Sun, 14 Dec 2003 15:41:10 +0100, Sebastian Bergmann escreveu:
> Andi Gutmans wrote: >> It is supported by "print" and for internal extensions such as >> SimpleXML which require this. > > How is it supported by "print" when > > print $defect->thrownException() > > does not work but the object returned from thrownException() has a > __toString() method?
IMHO I think it should be supported by print (echo). Without, this support, it will be only a naming convention... Cristiano Duarte