If your system has the fopencookie( ) function , you can even pass any PHP stream to any library that uses ANSI stdio !