Converter to replace PHP short open tags (shorttags) with long tags
This is a utility I wrote that converts PHP source that contains short open tags and replaces them with long tags.
i.e. it converts code like this:
<?= $var1 ?> <? printf("%u changes\n",$changes) ?>
<?php echo $var1 ?> <?php printf("%u changes\n",$changes) ?>
The --skip-echo-tags option will cause it to skip <?= tags and only replace <? tags.
It’s written as a PHP-CLI script and needs the CLI php.ini file to be set to permit short short open tags. That’s the default setting for PHP 5.3.0 and earlier, but it might not always remain so. The program simply won’t change anything if the setting isn’t enabled.