title: Can a PHP script abort itself or detect abortion?
body: <p>PHP scripts can <a href="https://stackoverflow.com/questions/1428340/can-a-php-script-continue-running-after-ending-the-http-request">continue executing after the HTTP page request</a>, so how do I finally stop it executing when I'm done with it?</p>
  
  <p>Also, is there an event to detect when the OS is going to forcibly abort the script? or how do I keep an internal timer to predict <code>max_execution_time</code>?</p>