protected function fill()
    {
        $readFilterCallback = $this->readFilterCallback;
        $this->buffer .= $readFilterCallback($this->stream->read(self::BUFFER_SIZE));

        if ($this->stream->eof()) {
            $this->buffer .= $readFilterCallback();
        }
    }
protected function fill()
    {
        $readFilterCallback = $this->readFilterCallback;
        $this->buffer .= $readFilterCallback($this->stream->read(self::BUFFER_SIZE));

        if ($this->stream->eof()) {
            $this->buffer .= $readFilterCallback();
        }
    }
protected function fill ( ) { $ readFilterCallback = $ this -> readFilterCallback ; $ this -> buffer .= $ readFilterCallback ( $ this -> stream -> read ( self :: BUFFER_SIZE ) ) ; if ( $ this -> stream -> eof ( ) ) { $ this -> buffer .= $ readFilterCallback ( ) ; } }
Buffer is filled by reading underlying stream.

Callback is reading once more even if the stream is ended.
This allow to get last data in the PHP buffer otherwise this
bug is present : https://bugs.php.net/bug.php?id=48725
Buffer is filled by reading underlying stream .