Created
June 14, 2012 19:51
-
-
Save nitrix/2932523 to your computer and use it in GitHub Desktop.
PHP challenge
This file contains hidden or 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 | |
$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 \"<?php\\n\"; | |
echo '\$y = \"' . q(\$y) . '\";'; | |
echo \"\\n\\neval(\"; | |
echo '\$y);'; | |
echo \"\\n?>\\n\"; | |
"; | |
eval($y); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My attempt at a PHP quine after seeing one by Trevor Sayre:
<?php printf($a='<?php printf($a=%c%s%c,39,$a,39);',39,$a,39);