title: php shell_exec adds unwanted line break
body: <p>Why does <code>php</code>'s <code>shell_exec</code> command add an unwanted line break (\r\n) to the output and how can I prevent that?</p>
  
  <p>test.php:</p>
  
  <pre><code>&lt;?php
  var_dump(shell_exec('echo "test"'));
  </code></pre>
  
  <p>running <code>php test.php</code> results in:</p>
  
  <pre><code>string(5) "test
  "
  </code></pre>