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 + + +]]> + +