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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.