title: die status code vs. normal status code
body: <p>FILE 1.php :</p>
  
  <pre><code>$cmd = 'php asynchronous_script.php -p 1';
  $exitCode = 0;
  $output = '';
  exec($cmd, $output, $exitCode);
  echo "\n\n";
  echo $exitCode;
  print_r($output);
  </code></pre>
  
  <p>FILE asynchronous_script.php :</p>
  
  <pre><code>&lt;?
  die("**");
  </code></pre>
  
  <p>When I run 1.php, I am getting status code as <code>0</code>.</p>
  
  <p>0 is status code for normal execution.</p>
  
  <p>So How can we differentiate between <code>die</code> status code vs normal status code?</p>
  
  <p>One solution that I am thinking of is to replace die with <code>die_with_status_code()</code>
  and implement:</p>
  
  <pre><code>function die_with_status_code()
  {
      exit(100)
  }
  </code></pre>
  
  <p>Is there any better approach for obtaining status code?</p>