I know this question seems hacky and weird, but is there a way to remove a function at runtime in PHP?
I have a recursive function declared in a \"if\" block and wan
There may be another solution for replacing functions by changing usage of them like this ;
function function1(){
echo "1";
}
function function2(){
echo "2";
}
if(FUNCTION_CHOOSER_CONDITION) $the_function = "function2";
else $the_function="function1";
$the_function(); // displays 2 if condition is TRUE;
Maybe this not for you in this situation as you wanted to destroy the function but i though this is right place to talk about replacement of functions.