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
This commit is contained in:
Adam Harvey 2012-12-05 01:19:20 +00:00
parent 92bf322f2a
commit 0dec5d1aea

View file

@ -136,6 +136,13 @@ class Connection
return a string, as otherwise a fatal <constant>E_RECOVERABLE_ERROR</constant>
level error is emitted.
</para>
<warning>
<simpara>
You cannot throw an exception from within a
<link linkend="object.tostring">__toString()</link> method. Doing so will
result in a fatal error.
</simpara>
</warning>
<example>
<title>Simple example</title>
<programlisting role="php">