mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
92bf322f2a
commit
0dec5d1aea
1 changed files with 7 additions and 0 deletions
|
@ -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">
|
||||
|
|
Loading…
Reference in a new issue