Re: __toString()
| From: | Andi Gutmans | Date: | Sun, 14 Dec 2003 13:17:06 +0000 |
| Subject: | Re: __toString() | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-6445@lists.php.net to get a copy of this message | ||
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() ); }Theprint $defect->thrownException() . "\n";line worked fine before and printed the result of$defect->thrownException()->__toString()Is this the intended behaviour? -- Sebastian Bergmannhttp://sebastian-bergmann.de/ http://phpOpenTracker.de/Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php