Documentation
For the haXe syntax reference and the API documentation, visit the haXe web site.
To compile for php use the -php switch on the haXe command-line followed by the directory where you want to output your pages. The class files will be put in a subdirectory lib and the optional resources will be put in the res directory. The -main switch creates an extra index.php to run your application in the output directory.
The haXe/PHP generator has only two magic functions: _ _php_ _ and _ _call_ _. The first is used to inject pure PHP code while the second is a shortcut to invoke the standard php functions.
untyped __call__("str_pad", s, l, c, __php__("STR_PAD_RIGHT"));
In PHP it is not possible to redefine the methods of an existing object without using an extension. To make dynamic function possible, the haXe/PHP generator uses a strategy very similar to the one adopted in Flash9; you will have to mark your dynamic functions as F9Dynamic (this will probably change with the advent of HaXe 2.0).
Method arguments prefixed with byref__ are passed “by ref” and not “by value”. This will work only on plain class methods (not F9Dynamic or closures).
Also a function that is prefixed with _ _byref_ _ will return “by ref” and has the same limitations as above.
The use of the byref features are strongly discouraged.