So after doing a spot of googling, I haven't found a good answer for this.
Got a script that runs daily on a client that operates on 500 records at a time. It fetches them and stores them in an object. What's the sensible way of clearing this object? What it does is this:
Which is fine since the obj gets overwritten inside the while loop, but after the loop finishes, I want to clear the memory of this object. Should I use unset or set the object to NULL? Or something else that I am not aware of?
Yes I can increase memory limits... but I would prefer not to have a massive memory intensive script running daily xD.
Got a script that runs daily on a client that operates on 500 records at a time. It fetches them and stores them in an object. What's the sensible way of clearing this object? What it does is this:
Code:
$obj = fetch500
while(more_records) {
$obj = fetch500
doStuff
}
Which is fine since the obj gets overwritten inside the while loop, but after the loop finishes, I want to clear the memory of this object. Should I use unset or set the object to NULL? Or something else that I am not aware of?
Yes I can increase memory limits... but I would prefer not to have a massive memory intensive script running daily xD.