title: Will PHP script be executed after header redirect?
body: <p>Yes, this question has been asked before, however, the answers have been inconsistent.  Take <a href="https://stackoverflow.com/questions/2747791/why-i-have-to-call-exit-after-redirection-through-headerlocation-in-php">Why I have to call &#39;exit&#39; after redirection through header(&#39;Location..&#39;) in PHP?</a> for instance.  Every answer (including the accepted answer) states yes, except the last answer which received zero votes which says "maybe".  I am starting to think the correct answer is "maybe".  To make it a simple "yes" or "no" question, will doThis() be executed given the following script?  Thanks</p>
  
  <pre><code>header('Location: http://somewhereElse.com');
  //die();
  sleep(1000);
  doThis();
  </code></pre>
  
  <p>EDIT
  Thanks, all. With my PHP/Linux/Apache configuration, the second syslog() executes, so the answer is "yes, all script down stream of the header will be executed."  I will assume (and hope I am correct) it is the same with all PHP/Linux/Apache configurations!</p>
  
  <pre><code>&lt;?php
    header('Location: http://google.com');
    syslog(LOG_INFO,'first');  
    sleep(5);
    syslog(LOG_INFO,'Second');  
  ?&gt;
  </code></pre>