While reading through the great online PHP tutorials of Paul Hudson he said
Perhaps surprisingly, infinite loops can sometimes be h
I'm going to disagree with the other answers so far, and suggest that, if you're being careful about things, they never have a place.
There is always some condition in which you want to shut down, so at the very least, it should be while(test if shutdown not requested) or while(still able to meaningfully run)
I think practically there are times when people don't use the condition and rely on things like sigint to php to terminate, but this is not best practice in my opinion, even if it works.
The risk of putting the test inside the loop and breaking if it fails is that it makes it easier for the code to be modified in the future to inadvertently create an endless loop. For example, you might wrap the contents of the while loop inside another loop, and then all of a sudden the break statement doesn't get you out of the while...
for(;;) or while(1) should be avoided whenever possible, and it's almost always possible.