I've been working on a Java to PHP translater. To php5, it's rather simple, because much of the syntax is very close.
The reason I started working on this:
-I like static types (much easier in the IDE when you can hover over the identifier and actually see the type, click to see type-definition, etc)
-Java IDEs are better than anything available for PHP (I've been using Eclipse for my Java coding recently)
-PHP5 is taking a loooooong time coming out
Right now, it's geared to translate to PHP5. I'm pretty sure that if I needed to, I could have it translate to PHP4.
(This is also a benefit to this translater; if you had to deploy your project before the host has PHP5, you at least get code that's more readable; the translater will do all ugly stuff such as changing object variables to references (buncha &'s don't look too pretty) )
1 problem I've realized is that Java has no global scope really. So, I'm just going to append at the end of each file with a global class a call to the global class' main function.
One downside to this approach is that debugging would have to be done in PHP. Then, once you found the bug, you would have to see where the bug is in the Java code.
Does anyone else think this is worthwhile?







Bookmarks