Created
February 15, 2011 23:12
-
-
Save purplejacket/828485 to your computer and use it in GitHub Desktop.
A quine in PHP language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
# PHP Quine written by Ian Kjos - [email protected] | |
$y = "function q(\$q) { | |
\$q = str_replace('\\\\', '\\\\\\\\', \$q); | |
\$q = str_replace('\$', '\\\\\$', \$q); | |
\$q = str_replace('\\n', '\\\\n', \$q); | |
\$q = str_replace('\"', '\\\\\"', \$q); | |
return \$q; | |
} | |
echo \"<?\\n\\n\"; | |
echo \"# PHP Quine written by Ian Kjos - [email protected] \\n\\n\"; | |
echo '\$y = \"' . q(\$y) . '\";'; | |
echo \"\\n\\neval(\"; | |
echo '\$y);'; | |
echo \"\\n\\n\\n\"; | |
"; | |
eval($y); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment