It should stop when the execution time limit is reached, which is usually just a minute. However note that this time does not include file I/O, so the amount of time it takes to write the error log may be extending the length of the script.
It will stop eventually, but you should contact your host and ask them to kill the process.
To prevent it happening in future, always check if the resource is valid before passing it to feof()
(Note that I really wish the function were fneof
instead "file not end of file" to prevent this kind of problem...)