|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-01-08 22:24 UTC] bjori@php.net
[2010-01-08 22:51 UTC] gmblar+php at gmail dot com
[2012-12-04 13:05 UTC] benjamin dot morel at strictcoding dot co dot uk
[2012-12-05 01:18 UTC] aharvey@php.net
[2012-12-05 01:19 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 11:00:01 2025 UTC |
Description: ------------ Cannot throw Exceptions in __toString(). Instead it produces a Fatal error. Reproduce code: --------------- <?php class bar { public function __toString() { throw new Exception('Incomplete Data'); } } $foo = new bar(); echo $foo; ?> Expected result: ---------------- Fatal error: Uncaught exception 'Exception' with message 'Incomplete Data' in /-:6 Actual result: -------------- Fatal error: Method bar::__toString() must not throw an exception in /- on line 0