Is it a good practice to unset the variables that you used in a class? Or its an optional?
If its a good practice what is the benefit of using the unset function?
unset
You really don't need to worry about cleaning up your variable declarations in PHP, its garbage collection takes care of all of that for you. Your __destruct() methods are primarily for things like closing persistent connections.
__destruct()
1.4m articles
1.4m replys
5 comments
57.0k users