src/LocalDateTime.php
public function plusYears(int $years) : LocalDateTime
    {
        if ($years === 0) {
            return $this;
        }

        return new LocalDateTime($this->date->plusYears($years), $this->time);
    }
public function plusYears(int $years) : LocalDateTime
    {
        if ($years === 0) {
            return $this;
        }

        return new LocalDateTime($this->date->plusYears($years), $this->time);
    }
public function plusYears ( int $ years ) : LocalDateTime { if ( $ years === 0 ) { return $ this ; } return new LocalDateTime ( $ this -> date -> plusYears ( $ years ) , $ this -> time ) ; }
Returns a copy of this LocalDateTime with the specified period in years added.

@param int $years

@return LocalDateTime

@throws DateTimeException If the resulting year is out of range.
Returns a copy of this LocalDateTime with the specified period in years added .