Created
May 26, 2022 14:42
-
-
Save mcdulltii/b636d9f33cfc38a7007a9e591176a7b6 to your computer and use it in GitHub Desktop.
Metamorphism in PHP
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 goto l01; | |
| l01: $filename = __FILE__; goto l02; | |
| l02: $contents = file_get_contents($filename); goto l03; | |
| l03: $lines = explode("\n",$contents); goto l04; | |
| l04: $collection = array(); goto l05; | |
| l05: $pattern = '%^[^:]+:.*goto [^;]+;$%'; goto l06; | |
| l06: $i = 0; goto l07; | |
| l07: /*while*/if ($i < count($lines)) goto l08; else goto l23; | |
| l08: $line = $lines[$i]; goto l09; | |
| l09: $line = trim($line); goto l10; | |
| l10: if (substr($line,0,2) != '//') goto l11; else goto l22; | |
| l11: if (preg_match($pattern, $line) === 1) goto l12; else goto l13; | |
| l12: $collection[] = $line; goto l22; | |
| // else | |
| l13: shuffle($collection); goto l14; | |
| l14: $j = 0; goto l15; | |
| l15: /*while*/if ($j < count($collection)) goto l16; else goto l19; | |
| l16: echo $collection[$j]; goto l17; | |
| l17: echo "\n"; goto l18; | |
| l18: $j++; goto l15; | |
| l19: $collection = array(); goto l20; | |
| l20: echo $line; goto l21; | |
| l21: echo "\n"; goto l22; | |
| l22: $i++; goto l07; | |
| l23: exit(0); goto l23; | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment