Parameters which have default values should be placed at the end.
If you place a parameter with a default value before a parameter with a default value,
the default value of the first parameter will never be used as it will always
need to be passed anyway:
// $a must always be passed; it's default value is never used.functionsomeFunction($a=5,$b){}
Loading history...
39
{
40
1
$this->headers = $headers;
41
1
$this->cookie = $cookie;
42
1
$this->output = $output;
43
1
}
44
45
/**
46
* Get response headers as an array, to be set in the index.php file
47
*
48
* ```
49
* foreach ($response->getHeaders() as $header) {
50
* header($header);
51
* }
52
* ```
53
*
54
* @return array
55
*/
56
2
public function getHeaders(): array
57
{
58
2
return $this->headers;
59
}
60
61
/**
62
* Get response cookie, to be set in the index.php file
If you place a parameter with a default value before a parameter with a default value, the default value of the first parameter will never be used as it will always need to be passed anyway: