Is it possible to allow redeclare function which is included to main script from another .php file?
Example - my function's php file:
<?php
my_func($arg)
{
return $arg;
}
?>
and my main php file:
<?php
for($i = 0; $i < 10; $i++)
{
include('./functions.php');
var_dump(my_func('test'));
}
?>
This return an error about redeclare function. I know, I can use function_exists() and include this function only once but I have 150 files with the same function's names but with another php code. I need to allow redeclare functions but how I can do it? Maybe I can clean from memory this function after included in some way?
Thanks.