Non-static methods need to use lower camel casing format - http://doc.silverstripe.org/framework/en/trunk/misc/coding-conventions

would it be simpler to just do `$indexes[$key] = preg_replace($unique_regex, 'index', $index);` instead of iterating items by reference?