I’ve thought about writing something like this for a while now, but so far haven’t had the impetus to do so. However, an upcoming project at work is going to be a PHP 5 migration. Presenting PHP_Migrate4to5, a tool to automate the grunt work of PHP 4 to 5 migration.
var keywords from class variables. Needed for E_STRICT.public/protected/private keywords to class variables and methods. If you use PhpDocumentor, it will use whatever you put in your @access tag. If your functions are prefixed with an underscore, it’s private; public if not. The docblock takes precedence over the function name.static keywords to class variables and methods, if @static is present in the docblock.__construct(). It also looks for the 4/5 compatibility hack, where you have a 4.x constructor that calls __construct(); in that case, the 4.x constructor is removed.
These features may or may not make it in.
$thisPEAR, PHP_Parser, and some PHP 4.x code. I don’t believe it will work with PHP 5 at the moment, since it has a new token for docblocks. It works fine with PHP 4.3.11.
$ php -q Migrate4to5.php Your-PHP4-Code.php > Converted-PHP5-Code.php
Get it here: v0.5.1.