Core Features
Support for all PHP language constructs
All PHP language constructs (statements, expressions, operators etc.) are translated into their Java™ equivalents. Even complex constructs, such as LIST statements or nested arrays, are properly handled.
PHP files are organized into include hierarchies, allowing the invocation of functions within the hierarchy. nTile PtoJ preserves include hierarchies and properly resolves the function calls.
To see specific examples, please consult the Samples section.
Type inference
PHP is a dynamically and weakly typed language, meaning that variables do not have a fixed type and can participate in all kinds of expressions, conversions being performed on-the-fly. On the other hand Java™ is a statically and strongly typed language, with each variable having a type that is fixed by a declaration, cannot change during the execution and limits the kinds of expressions and operations in which the variable can participate without explicit conversion.
Transformation of dynamic constructs
nTile PtoJ has specific algorithms for each category of dynamic constructs, transforming them into static evaluation expressions. Please consult the Dynamic Constructs samples for relevant examples.