By default the PHP process gets torn down the next time it tries to send output to the client¹, although you can change this behavior by using ignore_user_abort
. For additional related information, read the manual section on connection handling.
¹ Note that in the presence of output buffering by PHP or by the web server, "echoing something" does not necessarily equal "output is sent to the client"; see flush
.