Obviously you can't mix the "raw" Java and PHP syntaxes.
If you want to generate a PHP source file using Java, it's perfectly possible (a PHP source is, at the end, a pure text file).
If you want...