php - Does unsetting an array of objects unset just the array or also all the objects? -


I have an array of objects if I call the unset ($ array), then in that array and in organ. Will all the objects be unset or just array? Let's assume that these objects have not been referenced anywhere.

If that object contains only the reference of the object, then yes. Otherwise notwithstanding, keep in mind with some PHP documentation:

unset () what does its name say - do not set a variable - do not force it to free instant memory PHP's garbage collector will do this when it looks - soon intent, because those CPU cycles are not needed anyway, or the script is delayed before being out of memory, whatever happens before is.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -