The job is to write a PHP script which outputs its own source code. What comes out should be identical to what went in.
Testing will be via CLI:
php -f your_entry.php > your_result.php
your_entry.php and your_result.php will then be compared to see if they are the same program. As ever, running will be under E_ALL conditions, and try to stick to the core functionality of a typical PHP build (I won't be able to run it if you use SESAM functions...).
To make it a bit more challenging than a simple
<?php readfile(__FILE__)?>
(gee, don'tcha just love power?) or (to take an extreme, yet otherwise valid, example) a zero-length file, there are two provisos:
No file-related functions are to be used. This includes workarounds à la eval('r'.'e'.'a'.'d'.'f'.'i'.'l'.'e'.'('.''.''.'F'.'I'.'L'.'E'.''.''.')'.';');. Put simply: No reading files; no writing files. This includes databases.
There has to be some PHP code used.
I'll be lenient on whitespace; if I can't verify success by eye, I'll use a whitespace-insensitive diff. I might also do something with get_all_tokens(). Getting the whitespace right will of course be considered a bonus.
Elegance and simplicity count at least as much as brevity. That said, a bit of obfuscation is always good for a giggle. Laying out your source to make a pretty picture will also be smiled on (especially if the layout is retained in the output!).
If you like, you can also offer entries under variants of the challenge, if you say what the variation is to allow verifying that it's doing what it's supposed to. An example might be to have the script generate versions of itself which are identical except that variable and function names are created at random or according to some other criterion. Another might be a script A that generates a different script B that generates A.