I want to define a function and unset it after its use just like we do with variables.
$a = 'something';
unset($a);
echo $a; // outputs nothing
Just like this if i declare a function callMethod(), is there a way to unset it?
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.
As of PHP 5.3, you can assign an anonymous function to a variable, then unset it:
Before 5.3, you can do something similar with
create_function()