Clarify __tostring() a little, and mention it must return a string.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@303436 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2010-09-16 23:48:26 +00:00
parent 84414d17bf
commit 03977edc1f

View file

@ -114,7 +114,10 @@ class Connection
<title><literal>__toString</literal></title>
<para>
The <literal>__toString</literal> method allows a class to decide
how it will react when it is converted to a string.
how it will react when it is treated like a string. For example,
what <literal>echo $obj;</literal> will print. This method must
return a string, as otherwise a fatal <constant>E_RECOVERABLE_ERROR</constant>
level error is emitted.
</para>
<example>
<title>Simple example</title>