svn: /phpdoc/en/trunk/language/oop5/ magic.xml
| From: | Philip Olson | Date: | Thu, 16 Sep 2010 23:48:26 +0000 |
| Subject: | svn: /phpdoc/en/trunk/language/oop5/ magic.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-7124@lists.php.net to get a copy of this message | ||
philip Thu, 16 Sep 2010 23:48:26 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=303436
Log:
Clarify __tostring() a little, and mention it must return a string.
Changed paths:
U phpdoc/en/trunk/language/oop5/magic.xml
Modified: phpdoc/en/trunk/language/oop5/magic.xml
===================================================================
--- phpdoc/en/trunk/language/oop5/magic.xml 2010-09-16 21:49:48 UTC (rev 303435)
+++ phpdoc/en/trunk/language/oop5/magic.xml 2010-09-16 23:48:26 UTC (rev 303436)
@@ -114,7 +114,10 @@
<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>