Skip to content

Instantly share code, notes, and snippets.

@NichtJens
Forked from avafloww/PhpJava.java
Created September 1, 2016 04:23
Show Gist options
  • Save NichtJens/0e93c6194d3cb347881a2c4889080df6 to your computer and use it in GitHub Desktop.
Save NichtJens/0e93c6194d3cb347881a2c4889080df6 to your computer and use it in GitHub Desktop.
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
//\u000A\u002A\u002F
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
//\u000A\u002A\u002F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment