| PHP feature | What PHP2CPP does | Supported Lex/Run | Implemented in |
|---|---|---|---|
| Function use before declaration | Separate pass to get declarations | Y/Y | main() |
| Statements outside function bodies | Separate pass to create a main() | Y/Y | main() |
| Classes | Separate pass to write class declarations | Y/Y | main() |
| Standard escaping from HTML <?php ?> | calls to showhtml() | Y/Y | ProcessFile() |
| Alternative escaping from HTML<? ?> <% %> <script> | Not supported in this version | N/N | () |
| 3 styles of comments/* */, //, and # | /* */ or // The entire comment is recognized so that nothing inside is translated | Y/Y | transcomment() |
| String concatenation operator (.) | '+' overload to a string class | Y/Y | transDot() |
| Single quoted strings | Translates to " " | Y/Y | transSquote() |
| Double quoted strings, which interpret $variables | Split into constant "" with + operator | Y/Y | transDquote() |
| Strings can cross line boundaries | Translator issues warning | Y/Y | transDquote() |
| $Variables | Replacement of '$' with _s_ | Y/Y | transVar() |
| Variable variables ($$) | Not supported | N/N | () |
| Case sensitive variable names | Supported (No translation needed.) | Y/Y | () |
| Declare global variables inside function bodies | Lexical translation. | Y */N | transglobal() |
| Array subscripts[ ] | Translation of bare words to strings. PHP subscript must not cross line boundary | Y/Y | transSubscript() |
| Member of class access-> | Translates to '.' | Y/Y | transMember() |
| echo, print parameter without ( ) | Enclose parameter in ( ) | Y/Y | transReserved() |
| if() while() tests of strings and arrays | Enclose conditional expression in !!( ) which allows a ! operator overload to work. | Y */Y | transReserved() |
| elseif | Translate to 'else if' | Y/Y | transReserved() |
| low precedence operators 'or' , 'and' | Translate to ||, && (Wrong for precedence and when calling void() functions as the right hand parameter. ) | Y/N | transReserved() |
| low precedence operator 'xor' | Not supported | N/N | () |
| require, include | Supported | Y/Y | transReserved() |
| Remote URLs for require, include | Not supported in this version | N/N | () |
| @ (per-call error message suppression) | Replace with /*@*/ | Y/N | transAT() |
| Type juggling, undeclared variables | Strong typing with some automatic conversions | */* | () |
| Backticks system calls (``) | Not supported in this version | N/N | () |
| Deprecated syntax for control structures(:, endif, endswitch) | Not supported. Use the regular syntax | N/N | () |
| ===,!== (PHP4 only) | Not supported in this version | N/N | () |
| foreach (PHP4 only) | Not supported in this version | N/N | () |
| HEREDOC strings (PHP4 only) | Not supported in this version | N/N | () |
| Case insensitive function names | Not translated | */* | () |
| Local functions | Supported (No translation.) | */* | () |
| Variable functions | Not supported | N/N | () |