in src/io/BufferedReader.php [255:275]
public async function readByteAsync(
?int $timeout_ns = null,
): Awaitable<string> {
_OS\arg_assert(
$timeout_ns is null || $timeout_ns > 0,
"Timeout must be null, or greater than 0",
);
if ($this->buffer === '' && !$this->eof) {
await $this->fillBufferAsync(null, $timeout_ns);
}
if ($this->buffer === '') {
_OS\throw_errno(OS\Errno::EPIPE, "Reached EOF without any more data");
}
$ret = $this->buffer[0];
if ($ret === $this->buffer) {
$this->buffer = '';
return $ret;
}
$this->buffer = Str\slice($this->buffer, 1);
return $ret;
}