$date->year()
Gets or sets the year value
$date->year(int|null $year = null): int
Parameters
| Name | Type | Default |
|---|---|---|
| $year | intornull |
null
|
Return type
int
This method modifies the existing $date object it is applied to and returns it again.