title: Getting script exit status code in php
body: <p>Is there anyway to get the exit status code for a php script run in the background via exec($cmd, $output, $exitCode)?</p>
  
  <p>For example:</p>
  
  <pre><code>exec('php script.php &amp;', $output, $exitCode); 
  </code></pre>
  
  <p>If the trailing '&amp;' isn't included then $exitCode works as expected, it's always 0 otherwise.</p>