JAVAtoPHP


What JAVAtoPHP does:

Deep Java code inspection

Analysis includes three passes and attempted type resolution of your code before generation of equivilent or near-equivilent PHP.

Full abstract syntax tree parser

We use a full AST model to accurately parse your Java projects.

Interface and Enumeration support

Interface and Enumeration declarations are supported and converted to equivilent PHP classes automatically.

Inheritance (extends) and Interface (implements) support

Java inheritance is converted to equivilent PHP class inheritence.

Multiple constructor support

PHP does not natively support multiple constructors per class, but with our overload detection and resolution engine, JAVAtoPHP resolves multiple constructors both at point of declaration and when used in code. Static methods are used in place of the traditional __construct() method.

Overloaded method support

Again, PHP does not natively support method overloading, but with our overload detection and resolution engine your overloaded functions will be converted to unique seperate functions. Calls to overloaded functions are resolved where possible using type analysis, and the appropriate replacements are made in the output code.

Contextual type-based resolution for method and constructor calls

Our contextual type-based resolution engine performs a deep type inspection of the arguments passed into overloaded methods and constructors. Using the resultant type information, the engine attempts to match the call to the correct method or constructor.

Import support including static inputs and wild cards

Static and dynamic imports are accounted for with liberal translation to require_once() statements (with adapted paths) and accurate detection and scope resolution of static fields and methods.

Static and dynamic class member initialisation support

Because PHP does not natively support field initialization with non-primitive data, our engine introduces __init() and __staticinit() functions into each class. The first: __init() is called whenever a new instance of the class is created. The second: __staticinit() is called when the class is first loaded, and populates any static members with their correct values.

Converts whole Java projects to PHP syntax and semantics

Inspects your project directory structure and generates an equivalent project structure for the php project.

Easy to use single file download

JAVAtoPHP is written in Java, but packaged as a windows executable for your convinence. You may also download the jar file (linux, mac compatible) if you do not run windows.

What JAVAtoPHP doesn't do:

It is not magic!

It will make a best effort attempt at converting your project to PHP syntax and, where possible, translate semantics as required. It will not however (or is very unlikely to) convert your project entirely without the need for human intervention.

No libraries

It does not include a PHP version of the Java runtime environment or libraries. Calls to classes such as System and Arrays are left in (syntactically equivalent) PHP code. It is up to you to change these out or (at own risk) attempt to convert the parts of the JRE you require.

It is not provably correct

Do not use JAVAtoPHP on financial or critical systems software unless you are going to review every line of code yourself at the end.


Screenshot


Try the Demo    Buy the Software - Only $10!