OOP IN PHP FIFTH PART
THE MAGICAL DESTRUCT METHOD Usually the constructor is invoked automatically during the creation of an object, it is used to initialize the properties with the values passed in input, in general it initializes properties and services used by the class, by services I mean other objects that the class may need. Similarly when an object no longer needs to be in memory or because the script terminates or because there are no more references to that object PHP calls the method __destruct (). The method __destruct () is not a real destructor but it serves to do some operations [...]