Magic Methods in PHP ( __toString() ) Part -11

1,599 views · Published 23 December 2016 · 7:09 · Indexed 22 September 2026

Channel: Technical Suneja · 2016 · Education

Watch on YouTube

Published on Dec 23, 2016

Playlist Name  : Magic Methods in PHP Tutorial 

In this tutorial we will learn about Magic Methods in PHP such as : 

__toString() : 
 
The __toString() method allows a class to decide how it will react when it is treated like a string. For example, what echo $obj; will print. This method must return a string, as otherwise a fatal E_RECOVERABLE_ERROR level error is emitted.

If you have any query about these stuff than you can mail us on this email id :  [email protected]

Twitter id :https://twitter.com/tutorialspoint2

facebook : https://www.facebook.com/tutorialspoint2016

Instragram : https://www.instagram.com/tutorialspoint2016

Google plus : https://plus.google.com/+TutorialsPoint2016

Blogger : http://tutorialspoint2016.blogspot.in/

Don't forget to hit the Subscribe & Like button!

More from this channel