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:
The following code from PHPUnit stopped working after the recent changes
to __toString()protected function printDefectTrace(PHPUnit_Framework_TestFailure $defect) { print $defect->thrownException() . "\n"; print PHPUnit_Runner_BaseTestRunner::getFilteredStack( $defect->thrownException() ); }
The
print $defect->thrownException() . "\n";
line worked fine before and printed the result of
$defect->thrownException()->__toString()
Is this the intended behaviour?
--
Sebastian Bergmann
http://sebastian-bergmann.de/ http://phpOpenTracker.de/Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/
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/
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