preg_replace_callback stuck


I have an array of URLs I'm running thru an included preg_replace_callback function, the idea being that each loop will yield a new result.

Problem is that it keeps outputting only the first result, as if it stalls after processing the first URL.

Here is the code:

if (!function_exists('name')) {
function name($match)
$foo = preg_replace_callback("#[regex]#", "name", $bar);

Any ideas how I can get this to work properly? Thanks.