Magic Methods

class MyClass
{
    // Object is treated as a String
    public function \_\_toString()
 {
        return $property;
    }
    // opposite to \_\_construct()
    public function \_\_destruct()
 {
        print "Destroying";
    }
}
Comments