title: PHP doesn't detect connection abort at all
body: <p>I have read and deeply understood these:
  <a href="http://www.php.net/manual/en/features.connection-handling.php" rel="noreferrer">http://www.php.net/manual/en/features.connection-handling.php</a>
  <a href="http://www.php.net/manual/en/function.register-shutdown-function.php" rel="noreferrer">http://www.php.net/manual/en/function.register-shutdown-function.php</a></p>
  
  <p>However, I have tested both PHP 5.1.6 and 5.3 and things DON'T work as described there. What I observe is:</p>
  
  <ul>
  <li>connection_status() always return true, even after the client has closed the connection.</li>
  <li>execution of the script keeps going on after the client has closed the connection, even though ignore_user_abort is 0</li>
  <li>a function registered with register_shutdown_function() is not run until the script reaches ends. The script is NOT interrupted (and hence the function not called) when the client aborts the connection.</li>
  </ul>
  
  <p>So basically PHP just doesn't detect the client's disconnection AT ALL.</p>
  
  <p>Note that this is NOT as if ignore_user_abort was set to 1: if that was the case then connection_status() would return 1 even though the script would keep running and the shutdown function would not be called until the end. That is not the case.</p>
  
  <p>ini_get("ignore_user_abort") returns 0, as expected.</p>
  
  <p>Is this a bug in PHP, or may this be due to some Apache setting?</p>
  
  <p>How do I get PHP to work as described in the abovementioned documentation?</p>
  
  <p>Test script:</p>
  
  <pre><code>&lt;?php
  
  function myShutdown() {
      error_log("myShutdown ".connection_status()." ".ini_get("ignore_user_abort"));
  }
  
  register_shutdown_function(myShutdown);
  
  echo "Hi!";
  error_log(" *** test/test *** ");
  for ($i=0; $i&lt;10; $i++) {
      sleep(1);
      error_log(".");
      echo ".";
  }
  ?&gt;
  </code></pre>
  
  <p>Steps to reproduce:
  - visit the url of the script
  - abort the connection on the client before 10 seconds have elapsed (e.g. hit the stop button in the browser)</p>
  
  <p>Expected/Desired behavior:
  The logs should show less than 10 dots, and at the end "myShutdown 1 0" (if you watch the log in real time, the myShutDown should appear immediately when the client disconnects)</p>
  
  <p>Observed/current behavior:
  The logs show always exactly 10 dots, and at the end "myShutdown 0 0" (if you watch it in realtime, it goes on for 10 seconds no matter when the client disconnects).</p>