- 1. Call all possible shutdown functions registered with register_shutdown_function()
- 2. Call all possible __destruct() functions
- 3. Flush all output buffers
- 4. Send the set HTTP headers (note: This must be done AFTER php_output_discard_all() / php_output_end_all() !!)
- 5. Reset max_execution_time (no longer executing php code after response sent)
- 6. Call all extensions RSHUTDOWN functions
- 7. Destroy super-globals
- 7.5 free last error information
- 7. Shutdown scanner/executor/compiler and restore ini entries
- 8. Call all extensions post-RSHUTDOWN functions
- 9. SAPI related shutdown (free stuff)
- 10. Destroy stream hashes
- 11. Free Willy (here be crashes) -shuts down memory manager
- 12. Reset max_execution_time