News for hackers. Stuff that matters.
Re:Code that is valid in both PHP and Java, and produces the... by piaste on Thursday September 01, 2016 @03:50AM (#12403660)
Pretty disappointing that it relies so much on comments.

You can write an arbitrary 'polyglot' program in any N languages that have incompatible comment delimiters: just write the same program in each language and wrap it in the comment delimiters of the other N-1 programs. That's not interesting, though.

Re:Code that is valid in both PHP and Java, and produces the... by Retric on Thursday September 01, 2016 @08:34AM (#12404745)
That's not enough, if you start with language A's escape sequence /* that must not break languages B, C, D, E or F when starting a file with /* next B's escape sequence must not cause problems with C, D, E, or F. So, they must be different but still compatible.
Re:Code that is valid in both PHP and Java, and produces the... by ZoF on Thursday September 01, 2016 @04:20AM (#12403728)
Yep, I was expecting something different.