I use this function to replace thousands of regex codes:
function preg_replace_assoc(array $replace, $subject) {
return preg_replace(array_keys($replace), array_values($replace), $subject);
}
Now I upgraded to PHP 5.3.10 and I get some errors like:
Warning: preg_replace(): Compilation failed: missing ) at offset 18
Warning: preg_replace(): Compilation failed: nothing to repeat at offset 35
Warning: preg_replace(): Unknown modifier '-'
How can I debug this? PHP doesn't print the array keys.