Removing a function at runtime in PHP -


I know that this question is awkward and strange, but is there a way to delete the function in runtime in PHP?

I have a recursive function declared in the "if" block, and that function must be placed in the "if" block in the "valid" block. I do not want this function to be called outside of this block.

I have come to know but not enabled on my web host

BTW I only support PHP 5.1.0.

Edit: I knew how my question was, but this is the exact thing that I want to do:

  if (function_exists ('Get_magic_quotes_gpc') and @get_magic_quotes_gpc ()) {function strips lash_dip ($ value) {return is_array ($ value)? Array_map ('strips lash_dip', $ value): stripsshash ($ value); } $ _POST = array_map ('strips lash_dip', $ _POST); $ _GET = array_map ('strips lash_dip', $ _GET); $ _COOKIE = array_map ('stripsshash_dip', $ _COOKIE); $ _REQUEST = Array_mape ('strips lash_dip', $ _REQUEST); // runkit_function_remove ('stripslashes_deep'); }  

Since "stripsash-deep" only live when the magic quatts are on, I wanted to get rid of it when I would do it with me Wanted that people rely on such functions which do not always there I hope that it is now clear that non-hami solution suggestions are also welcome! From

to:

All functions and classes in PHP are global scales. They can be called outside of a function even if they are defined in and vice versa. [...] The PHP function does not support overloading, nor is it possible to define or redefine the previously declared task.

Exception is runkit, however, you can define your function and after running it, like

Some commentators have correctly told (but nowadays there is not an issue in PHP), you can not call an anonymous function within yourself. You can find around this limit by using the array_walk_recursive . Personally, I'll just make a regular function and I'm not worried about removing it. It will not hurt anyone stripslashes_gpc_callback as soon as it's the proper name.

Note: Edited and abbreviated after comments


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 -