The error says this file has already run, and already declared that function. If you're including test.php from another file, try using include_once or require_once every time you include it. If you need the file to really be included/run more than once then wrap your function declaration with a function_exists check.
P.S. Sorry that I'm not patient enough to search through all 200 results for "Cannot redeclare" ...
And how many of those 200 questions exist because those people weren't "patient enough" to look through the 150, 100, 50, 10, 5, or 1 search result(s) for "Cannot redeclare" when they had the problem. The next person will have 201 search results to not be patient enough to look through. Imagine how many people here will no longer be patient enough to answer the same question for the 202nd time.