Adding PHP function code to a node returns Eval error I activated the PHP filter and it works fine, except when I declare a function.
I keep getting the following error.


  Fatal error: Cannot redeclare test_function_test() (previously declared in /web/htdocs/www.example.org/home/modules/php/php.module(80) : eval()'d code:3) in /web/htdocs/www.example.org/home/modules/php/php.module(80) : eval()'d code on line 1034


First, I tried with the following code.

function test_function_test() {
  echo "test";
}


Then, I tried using function_exists().

if (!function_exists('test_function_test')) {
  function test_function_test() {
    echo "test";
  }
}


In both cases, I keep getting the same error message.

How can I use a define a function in the code passed to the PHP filter, without getting this error?
You can try adding declaration of the function in your module.
But call it using php filter.

Moreover, in this case you will be able to edit code of your function with less chance of break the site.