Вы ставите $ перед функцией.
$returnValue = preg_replace(array($pattern1, $pattern2), array('width="200"','height="200"'), $subject);
Ваш сценарий может быть упрощен с помощью следующего:
$returnValue = preg_replace('/(width|height)="[0-9]*"/g', '$1="200"', $subject);