function toArray($crlf = true)
{
$headers = array();
foreach ($this->_headers as $header) {
$string = $header->__toString();
$headers[] = $crlf ? $string : rtrim($string);
}
return $headers;
}
public function testSimpleUsage() { $collection = new Http\HeaderCollection(); $collection->add('Content-Length: 9'); $this->assertEquals($collection->values('Content-Length'), array('9')); $this->assertEquals($collection->value('Content-Length'), '9'); $this->assertEquals($collection->toArray(false), array('Content-Length: 9')); }