No, that is an absolutely pointless use of exit()
. If you absolutely need one, just put it at the end of the script. Using exit()
like that is only useful if you provide an exit code (used in command line applications).
solved What is the point of exit() after each if statement? [closed]