cvs: phpdoc /en/language/oop5 magic.xml

From: Date: Sat, 12 Aug 2006 16:09:29 +0000
Subject: cvs: phpdoc /en/language/oop5 magic.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969373741@lists.php.net to get a copy of this message
nlopess Sat Aug 12 16:09:29 2006 UTC Modified files: /phpdoc/en/language/oop5 magic.xml Log: fix #37702: __toString() is now more magical since php 5.2 http://cvs.php.net/viewvc.cgi/phpdoc/en/language/oop5/magic.xml?r1=1.12&r2=1.13&diff_format=u Index: phpdoc/en/language/oop5/magic.xml diff -u phpdoc/en/language/oop5/magic.xml:1.12 phpdoc/en/language/oop5/magic.xml:1.13 --- phpdoc/en/language/oop5/magic.xml:1.12 Thu Nov 3 10:45:47 2005 +++ phpdoc/en/language/oop5/magic.xml Sat Aug 12 16:09:29 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.12 $ --> +<!-- $Revision: 1.13 $ --> <sect1 id="language.oop5.magic"> <title>Magic Methods</title> <para> @@ -139,33 +139,10 @@ </screen> </example> <para> - It is worth noting that the <literal>__toString</literal> method - will only be called when it is directly combined with + It is worth noting that before PHP 5.2.0 the <literal>__toString</literal> + method was only called when it was directly combined with <function>echo</function> or <function>print</function>. </para> - <example> - <title>Cases where <literal>__toString</literal> is called</title> - <programlisting role="php"> -<![CDATA[ -<?php -// __toString called -echo $class; - -// __toString called (still a normal parameter for echo) -echo 'text', $class; - -// __toString not called (concatenation operator used first) -echo 'text' . $class; - -// __toString not called (cast to string first) -echo (string) $class; - -// __toString not called (cast to string first) -echo "text $class"; -?> -]]> - </programlisting> - </example> </sect2> <sect2 id="language.oop5.magic.set-state">

« previous php.doc (#969373741) next »