HH\Lib\IO\BufferedReader::isEndOfFile

Meta Engineer?

The containing class is available as IO\BufferedReader in the www repository.

If we are known to have reached the end of the file

public function isEndOfFile(): bool;

This function is best-effort: true is reliable, but false is more of 'maybe'. For example, if called on an open socket with no data available, it will return false; it is then possible that a future read will:

  • return data if the other send sends some more
  • block forever, or until timeout if set
  • return the empty string if the socket closes the connection

Additionally, helpers such as readUntil may fail with EPIPE.

Returns

  • bool