I was looking for the __destroy() method in ArrayObject but found no implementation.
If I set the variable containing an ArrayObject to NULL, will it correctly destroy all the objects stored in it and free memory? Or should I iterate the ArrayObject to destroy each of the objects before unsetting it?
I was looking for the __destroy() method in ArrayObject but found no implementation. If
Share
When you unset or null the ArrayObject only the ArrayObject instance is destroyed. If the ArrayObject contains other objects, those will only be destroyed as long as there is no reference to them from somewhere else, e.g.
Also see http://www.php.net/manual/en/features.gc.refcounting-basics.php