Background
Problem
HaXe's PHP generator is either totally borked, or I've done something wrong. When I try to include
the generated php file containing main()
, I get an error like this:
Fatal error: Cannot redeclare _hx_add() (previously declared in /home/owner/Projects/mdown/build/php/lib/php/Boot.class.php:13) in /home/owner/Projects/mdown/build/php/lib/php/Boot.class.php on line 842 Call Stack: 26.8369 60580 1. {main}() php shell code:0 26.8373 692944 2. include_once('/home/owner/Projects/mdown/build/php/mdown.php') php shell code:0 26.8670 1713980 3. require_once('/home/owner/Projects/mdown/build/php/lib/php/Boot.class.php') /home/owner/Projects/mdown/build/php/mdown.php:0
It looks like everything loads through the SPL autoloader, which I've never really used much. I have no idea how to proceed, and google yields nothing. Any ideas?
I've put the entire source into a google code project here: http://code.google.com/p/mdown/
The PHP files in question can be found here.
Update: The error isn't happening in the autoloader callback. I can comment out the include ...
line in the autoloader callback and I still get the same error.
Another update: The problem only seems to affect the interactive PHP shell. Guess it was a problem with the shell and not HaXe. I'm seeing some other weird issues now with regex and backreferences, but I think they'll have to wait until Monday.