Use php://temp instead of tmpfile(). #performance

Because php://temp starts by placing the content of the stream in the memory before reaching a certain size and therefore switching to a real file, we can save a lot of I/O here!