I have learned from this SO question that the best way to destroy objects in PHP is to use unset
.
I am wondering if I even need to destroy the object if I am essentially using the same var in a loop ...
foreach ($ids_array as $id) {
$O = new Object($id);
// stuff and things
}
Does this really use the same memory or am I unknowingly creating a bunch of objects and not destroying them?