From 7c461dd6d585104385aba5152f9c74a921310e57 Mon Sep 17 00:00:00 2001 From: Aidan Lister Date: Mon, 11 Oct 2004 06:27:51 +0000 Subject: [PATCH] Clarified when __toString is called (bug #30379) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@170420 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/oop5/magic.xml | 42 ++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/language/oop5/magic.xml b/language/oop5/magic.xml index 30427394de..30f6588608 100644 --- a/language/oop5/magic.xml +++ b/language/oop5/magic.xml @@ -1,5 +1,5 @@ - + Magic Methods @@ -64,10 +64,12 @@ The __toString method allows a class to decide how it will react when it is converted to a string. - + + Simple example + ]]> - - &example.outputs; - + + &example.outputs; + - + + + + It is worth noting that the __toString method + will only be called when it is directly combined with + echo or print. + + + Cases where <literal>__toString</literal> is called + + +]]> + +