public function shift($bytes)
    {
        $bufferLen = strlen($this->buffer);

        if ($bytes === $bufferLen) {
            $return       = $this->buffer;
            $this->buffer = '';
        } else {
            $return       = substr($this->buffer, 0, $bytes);
            $this->buffer = substr($this->buffer, $bytes);
        }

        return $return;
    }
public function shift($bytes)
    {
        $bufferLen = strlen($this->buffer);

        if ($bytes === $bufferLen) {
            $return       = $this->buffer;
            $this->buffer = '';
        } else {
            $return       = substr($this->buffer, 0, $bytes);
            $this->buffer = substr($this->buffer, $bytes);
        }

        return $return;
    }
public function shift ( $ bytes ) { $ bufferLen = strlen ( $ this -> buffer ) ; if ( $ bytes === $ bufferLen ) { $ return = $ this -> buffer ; $ this -> buffer = '' ; } else { $ return = substr ( $ this -> buffer , 0 , $ bytes ) ; $ this -> buffer = substr ( $ this -> buffer , $ bytes ) ; } return $ return ; }
shift bytes from buffer

@param $bytes - up to buffer-length bytes

@return string
shift bytes from buffer