Skip to content

Instantly share code, notes, and snippets.

@yasirtaher
Forked from avafloww/PhpJava.java
Created September 2, 2016 04:03
Show Gist options
  • Save yasirtaher/aded90ccb7be8ba2dbdf5ea1d22a3ab5 to your computer and use it in GitHub Desktop.
Save yasirtaher/aded90ccb7be8ba2dbdf5ea1d22a3ab5 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 {
static 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 {
static 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