If PHP is trying to read past the end of a file it is most likely an open bracket (like {) that isn’t matched up with a closing bracket (like }).
If you use something like notepad++ it will show matching pairs of brackets, download that (or something similar) and put } at the end of the file and if it matches something it will show it and you can see where you have a bracket that is not being closed.
Or just put } just before the ?> at the end of the file and see if it clears it up.