diff --git a/src/Stream/BufferedStream.php b/src/Stream/BufferedStream.php index cf23fc7..289ff8c 100644 --- a/src/Stream/BufferedStream.php +++ b/src/Stream/BufferedStream.php @@ -170,6 +170,9 @@ public function read(int $length): string if ($length < 0) { throw new \InvalidArgumentException('Can not read a negative amount of bytes'); } + if (0 === $length) { + return ''; + } $read = '';