Created
May 5, 2014 18:28
-
-
Save igorw/4316810f8875f7e18b24 to your computer and use it in GitHub Desktop.
Self-modifying quasi-quine. Try running it, then piping the output into PHP. Then piping that output into PHP again. Then piping that output into PHP again. Then piping that output into PHP again. Then piping that output into PHP again. Then piping that output into PHP again.
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 | |
$data = <<<'DATA' | |
$program = <<<PROGRAM | |
<?php | |
\$data = <<<'DATA'\n$data\nDATA; | |
$data | |
PROGRAM; | |
$n = 0; | |
if ($n >= 5) { | |
echo "OMFG!\n"; | |
} else { | |
echo str_replace('$n = 0;', '$n = '.($n+1).';', $program); | |
} | |
DATA; | |
$program = <<<PROGRAM | |
<?php | |
\$data = <<<'DATA'\n$data\nDATA; | |
$data | |
PROGRAM; | |
$n = 0; | |
if ($n >= 5) { | |
echo "OMFG!\n"; | |
} else { | |
echo str_replace('$n = 0;', '$n = '.($n+1).';', $program); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@enygma you got it!