Obfuscated PHP:
Obfuscation is the art of making something very difficult to read. Obfuscated code is code that isn't immediately obvious to the reader what it's supposed to do. Obfuscated PHP is code written in PHP that you could look at, read, digest, and still only know what it does by running it. This isn't the same as "bad code". Obfuscated code has to be written very carefully otherwise it probably won't work.
The Contest:
Write a PHP script that will output a string backwards. The string will be passed as a _GET variable. The code must be as non-obvious as possible. It should be pretty much impossible to deduce the purpose of the script just by looking at it.
The Podium:
There are 3 winners;
3rd place - The Avrial Lavigne "Complicated!" award for the most complicated solution.
2nd place - The Kylie Minogue "Short like a tiny pixie!" award for the shortest solution.
1st place - The Jennifer Love Hewitt "OMG that's frickin' beautiful!" award for the most elegant solution.
The Rules:
1. Your code must be your own.
2. Your code must run in your own webspace so we can see it working.
3. Your code must only be ordinary PHP (Zend Optimizer is cheating).
4. Your code must be made available (duh, it's a code contest).
5. You should be able to explain how your code works in case we can't figure it out.
6. The judge's decision will be final (I'm the judge for now, might change later if people are actually interested in this).
7. All entries should be submitted as a reply to this thread in the form of a link to your script online somewhere and the source code (wrapped in
Code: Select all
tags, obviously).
8. Closing date is September 9th 2006. You've got 1 month.
Hints:
1. Think out of the box.
2. Try writing code that generates new code.
3. Eval() is your friend.
4. So is create_function().