From 0dec5d1aea785cbc56e3f2b22304443f1a39247c Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 5 Dec 2012 01:19:20 +0000 Subject: [PATCH] Add a warning about the fatal error generated when you throw from __toString(). Prompted by bug #50699, although it doesn't really fix it as such. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@328669 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/oop5/magic.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/language/oop5/magic.xml b/language/oop5/magic.xml index a01452cf53..00f85b9f9b 100644 --- a/language/oop5/magic.xml +++ b/language/oop5/magic.xml @@ -136,6 +136,13 @@ class Connection return a string, as otherwise a fatal E_RECOVERABLE_ERROR level error is emitted. + + + You cannot throw an exception from within a + __toString() method. Doing so will + result in a fatal error. + + Simple example