If you try to write some output to the browser in this loop, you should find the script termination if the connection was interrupted. This behavior is outlined in the documentation for ignore_user_abort
When starting PHP as a command line, the script and script tty goes without completing the script, then the script will die the next time it will try to write something if the value is not set to TRUE
I tried several experiments myself and found that even if you try to execute any output in the browser, the script will continue to work if the output buffer is not already full. If you disable output buffering, the script will abort when you try to exit. This makes sense - the SAPI layer should notice that the request was aborted when it tries to transmit the output.
Here is an example ...
This shows what causes the interrupt. If you had a script that was subject to an infinite loop without output, you can use connection_aborted () to check if the connection is still open.
source share