# __toString()

- Thread: https://externals.io/message/6439
- Original archive: https://news-web.php.net/php.internals/6439
- Started by Sebastian Bergmann on 2003-12-14T07:56:15+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #6439 — Sebastian Bergmann — 2003-12-14T07:56:15+00:00

URL: https://externals.io/message/6439#6439

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/
