Hint: if you're caught in an infinite loop, pressing "Esc" (or "Stop") will stop your browser from receiving any more code, which should stop the webserver from sending more code, which should stop PHP from processing more code. 🙂
Also, PHP scripts have a built-in execution time-limit of 30 seconds (anyone know if this has changed in recent versions? I'm using 4.3)