Core Features
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.
This means that one of the most complex issues of the migration is determining a type for each variable used within the application, and also executing type conversions where necessary. The algorithms embedded in nTile PtoJ perform the type inference, based on the expressions and operations in which a variable participates. See the Type Inference samples for relevant examples.
There are situations when not enough contextual information is available for accurate type inference, and the translated type remains Object (the most generic Java™ type). nTile PtoJ provides mechanisms for manual override of variable types, in order to overcome this issue.