I trialled a web application a while back that had been written half in short tags and half in full tags. I work with short_tags off 'cos I often have XML flying about, so it niggled. I knocked this out to run from the command line - pass it the name of a file: >php foo.php. All I can say about its MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE is that It Worked For Me™
<?php
$sr = array(
'<?='=>'<? echo',
'<?'=>'<?php ',
'<?php php'=>'<?php',
'<?php xml'=>'<?xml',
'<?php '=>'<?php ');
file_put_contents(
$argv[1],
str_replace(
array_keys($sr),
array_values($sr),
file_get_contents(
$argv[1])));
?>