I was thinking of a compiler that spits out C/PHP polyglots, but not sure if possible. Main issue is the PHP opening/closing brackets, <?php and ?>. I wanted to make them as macros that expand to nothing, but macros can't have such identifiers. Any way around this?
#define <?php
#define ?>
#define $
The polyglot does not need to be readable, semi-readable is good enough. Thankful for any feedback!
One small example:
And with C syntax highlight (but same piece of code):
Edit: Well the
intfunction type won't work. Right now, I'm using#__C__prefix on such lines, and then sed to remove it before compiling. So not 100% polyglot, sadly. ^^