title: PHP and stdin/stdout: where is the extra newline at the beginning coming from?
body: <p>I'm using PHP to process some files (run regexp, replace etc) and I've noticed that after processing, there's always a newline at the beginning of all the files I've processed. I've narrowed it down to these few lines:</p>
  
  <pre><code>#!/usr/bin/php
  
  &lt;?php
  $test = file('php://stdin');
  
  file_put_contents('php://stdout',$test);
  
  ?&gt;
  </code></pre>
  
  <p>If you save this and pipe some text through it, you'll notice there's a newline at the beginning of the output. Where is it coming from and how do I get rid of it? Thanks!</p>
  
  <p>PS: PHP version is: PHP 5.3.6 with Suhosin-Patch (cli) (built: Sep  8 2011 19:34:00)</p>