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