Are these correct:
Any PHP object always gets deleted after it is run (like the code of it).
unset($objectName)
just stimulates what would happen anyway. The deletion will be a little bit faster (from RAM memory) but in the end it is exactly the same thing.__destruct
is like an event that gets run prior to deleting an object, so we can have it or not. Any code can be run within that.
Does unset()
has anything to do with __destruct
? Like it would just go to that (as the only step) and then delete?