For example:
I have a object created with $object = new stdClass(); it’s passed onto a function.
My question is whether the memory allocated for this object is ever freed, if so when does it get freed.
Also how will one check for these changes to memory.
I manually unset($object); right now, just to be safe.
Objects are destroyed on the end of the script execution. You can try it out:
When calling this script in the browser you get the Construct and Destruct output which proves that the object was successfully destroyed on the end of script execution.