1 # http\Message http\Message::setHeaders(array $headers = NULL)
3 Set the message headers.
4 See http\Message::getHeaders() and http\Message::addHeaders().
7 > Prior to v2.5.6/v3.1.0 headers with the same name were merged into a single
8 > header with values concatenated by comma.
12 * array $headers = NULL
13 The message's headers.
22 $msg = new http\Message;
25 "Content-Type" => "text/plain",
26 "Content-Encoding" => "gzip",
27 "Content-Location" => "/foo/bar"
29 var_dump($msg->getHeaders());
31 $msg->setHeaders(null);
32 var_dump($msg->getHeaders());
39 string(10) "text/plain"
40 ["Content-Encoding"]=>
42 ["Content-Location"]=>
51 -------------|--------
52 2.5.6, 3.1.0 | Multiple headers with the same name are kept separate instead of merged together.