This code:
$t = 100;
$str = preg_replace_callback("/(Name[A-Z]+[0-9]*)/",
create_function(
'$matches',
'return $matches[1] + $t;'
), $func);
How to make $t visible from create_function() in preg_replace() function?