Alex Netkachov has found out something interesting - the default "file" stream wrapper can be overridden.
I find today that the default "file" stream wrapper in PHP is overwritable. You only need to call stream_wrapper_unregister and then stream_wrapper_register with your wrapper.
He gives an example of a situation where you might need to "catch" certain files as they're requested and replace them with another before they make it back to the source. His example code shows how to create the stream (using stream_open) and set methods to read, write, seek and work directly with the stream resource. It takes the file requested and replaces the "5" in the name - "test.php" is included instead of "test.php5".