Skip to content

Instantly share code, notes, and snippets.

Created August 9, 2017 06:40
What would you like to do?
PHP Magic Method __toString()
class Dog {
public $test = "Hello from Dog Class";
public function __toString() {
return $this->test;
$dog = new Dog();
echo $dog;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment