Any thoughts about how to fix this issue?
Tue, Aug 11
I guess we could also check the result of the first fread($stream, 1), but I think the proposed change is good enough.
It's not quite clear to me how simply ignoring if the stream is at the end is a valid error handling strategy (it seems we aren't buffering the existing data, so it would be lost?), but if it's acceptable for the properties above I suppose it is ok here too.