Destructor in PHP
In this article I explain about how to use destructor in PHP.
The destructor is another feature of "OOP". The destructor concept was introduced in PHP5 and it is conceptually similar to that of other object oriented languages. The destructor method will be called as soon as there are no other references to a particular object or when the object has been explicitly destroyed.
print "In constructor";
$this->name = "MyClass obj explicity";
print "Destroying " . $this->name . "\n";
$obj = new Myclass();