I\'m wondering if it is at all possible to create a stream wrapper in order to load some code from an array into using something like the following
Since include can use any appropriate stream and you can register your own stream wrapper, I don't see why not.
include
Just for fun you could try an alternative: load your data from memcached and include it using the data stream wrapper.