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 similar to C. It is all of the function calls and class calls that seem to go nowhere and the fact that a var can be declared in the !middle of an expression! that is spinning my head, oh and the fact that there is zero ‘0’ documentation.
What is the best method (and/or) tool (and/or) reference material to convert the php into java code?
edit: There is 3 reasons that I am having to convert the php to java.
- The usual reason, my boss told me too.
- The php is too slow, it is taking minutes sometimes to run a request to the server.
- php is a nightmare to scale and maintain.(at least for us strong typed language types)
You ask about best practices. I believe a good practice in your case is the approach pleasantly presented by theman: using an automated tool will probably give a bad result: garbage in, garbage out…
You have the code: analyze it, in its broad lines if necessary. And re-create it in Java. It might be time-consuming, but not necessarily worse than by doing blind conversion. And you can document on the way, and perhaps use this analysis to find the problematic parts.