Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
@avaleriani
Copy link

avaleriani commented Sep 1, 2016

Phava +1

@atkawa7
Copy link

atkawa7 commented Sep 1, 2016

Phava +1

@Bankq
Copy link

Bankq commented Sep 1, 2016

👍

@krupalshah
Copy link

krupalshah commented Sep 1, 2016

I showed it to my boss and he now wants PHava in production. He believes in cheap and fast. :P

@john-w-k
Copy link

john-w-k commented Sep 1, 2016

I'm going to create an IDE for this called "Chianti"

@alrz
Copy link

alrz commented Sep 1, 2016

I don't know what is that function in Java ..

@IllusionMH
Copy link

IllusionMH commented Sep 1, 2016

@cpmiller but why not PHava Jeans?

@brunoleles
Copy link

brunoleles commented Sep 1, 2016

@mendelgusmao
Copy link

mendelgusmao commented Sep 1, 2016

Phava +1

It reminds me a bit of the portuguese expression "vá às favas", which grossly translates to "gtfo"

lol

@krhancoc
Copy link

krhancoc commented Sep 1, 2016

Don't let you're Phava dreams be dreams guys.

@clod81
Copy link

clod81 commented Sep 1, 2016

a3ac1c00f83229732d780f09464fe58cdd9e93f4_m

@ramonmoraes8080
Copy link

ramonmoraes8080 commented Sep 2, 2016

its_a_no_for_me

@NotMrPink
Copy link

NotMrPink commented Sep 2, 2016

You were so preoccupied with whether or not you could, you didn't stop to think if you should.
+1

Phava
+1

@hbthegreat
Copy link

hbthegreat commented Sep 2, 2016

Why is Phava phaping?

@matejjelic
Copy link

matejjelic commented Sep 2, 2016

But... will it blend?

@RSickenberg
Copy link

RSickenberg commented Sep 2, 2016

Just here to read the comments

@Marti2203
Copy link

Marti2203 commented Sep 2, 2016

Can somebody explain what happens after the printf, a string is printed and after that I haven't got a clue what is going on except that a class is created.

@jmcclell
Copy link

jmcclell commented Sep 2, 2016

Sure, but does it transpile to Javascript?

@castroalves
Copy link

castroalves commented Sep 2, 2016

Why not Japha?

@saturnaut
Copy link

saturnaut commented Sep 2, 2016

juba

@JesterXL
Copy link

JesterXL commented Sep 2, 2016

Am I the only one who thought about the current USA election when seeing both code snippets?

@sebastian-zmijewski
Copy link

sebastian-zmijewski commented Sep 3, 2016

PHava+1

gif

@shubanker
Copy link

shubanker commented Sep 4, 2016

I once had a similar idea of PHP in java and created this

@ishaadX
Copy link

ishaadX commented Sep 4, 2016

Yoo Bro!

@ndugger
Copy link

ndugger commented Sep 6, 2016

This is disgusting, and you should be ashamed. Both languages are already gross; mashing them together just makes me sick.

@index0h
Copy link

index0h commented Sep 11, 2016

+1 bravo!

@imachug
Copy link

imachug commented Sep 12, 2016

+1 for Phava!

@0x00000FF
Copy link

0x00000FF commented Jul 7, 2019

What the...

@MACEL94
Copy link

MACEL94 commented Jan 27, 2020

I'd like to suggest we call this new language Phava.

+1

@ejemba
Copy link

ejemba commented Feb 11, 2020

I suggest jhj
this is the only honest name I can produce for this stuff ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment