I have been tasked with converting several php classes into java classes, which is quickly becoming a nightmare for me. I understand the basic language structure, it being simil
A human is the best tool.
I would try to rewrite the php to remove most of the php features to something C like. Then you'll have an easy time rewriting in Java.
But I need to ask, why do you need to convert the php? Can you not wrap the php into something callable from Java? This way you won't add any errors while converting it.
I would normally take the class generated by php5servlet, a jar thats available in tomcat & resin.
Then change the class file to Java.
cheers
I can only find two:
1) https://github.com/bafolts/java2php
2) http://www.runtimeconverter.com/
There is also Caucho Resin, but it is not exactly a converter. It is an implementation of php inside of Java.
There is a whole lot on the internet about numiton, but their website is down for several years now.
I said this in the PHP Optimization Tips question and I'll say it again here: If you're running PHP from a static environment (web server module or FastCGI), use an opcode cache, such as APC. Otherwise, PHP is reinterpreting/recompiling your code on every request!
For completeness, I should point out that there is a PHP runtime for the JVM. Check out Quercus.
You might consider leaving your current codebase in PHP and just getting it to run on the JVM. You can then rewrite code in Java as needed.