RewriteMap and PHP (buffering issue)

Has anyone here used a PHP prg: with RewriteMap? If so, did you encounter any buffering problems with STDIN and STDOUT? How did you get around them?\

Thanks!