src/Buffer.php
protected function getLength($limit)
    {
        $size = strlen($this->data);
        if ($limit <= 0) {
            $limit += $size;
        }

        if ($limit > $size) {
            return null;
        }

        $res = (string) substr($this->data, 0, $limit);
        $this->data = (string) substr($this->data, $limit);
        return $res;
    }
protected function getLength($limit)
    {
        $size = strlen($this->data);
        if ($limit <= 0) {
            $limit += $size;
        }

        if ($limit > $size) {
            return null;
        }

        $res = (string) substr($this->data, 0, $limit);
        $this->data = (string) substr($this->data, $limit);
        return $res;
    }
protected function getLength ( $ limit ) { $ size = strlen ( $ this -> data ) ; if ( $ limit <= 0 ) { $ limit += $ size ; } if ( $ limit > $ size ) { return null ; } $ res = ( string ) substr ( $ this -> data , 0 , $ limit ) ; $ this -> data = ( string ) substr ( $ this -> data , $ limit ) ; return $ res ; }
Return a limited amount of data from the buffer.

\param int $limit
Number of bytes to retrieve from the buffer.

\retval string
Exactly $limit bytes of data from the buffer.

\retval null
The buffer contains less than $limit bytes
of data.
Return a limited amount of data from the buffer .