When you don’t have any POST data, your variable $_POST is still an empty array, so this means that it is set.
If you want to do exit, you should check $_POST variable with empty() function.
solved Hello world, why this code doesn’t work? [closed]