public function addMonths($delta)
    {
        $interval = new DateInterval('P'.abs($delta).'M');

        if ($delta > 0) {
            $this->add($interval);
        } elseif ($delta < 0) {
            $this->sub($interval);
        }

        return $this;
    }
public function addMonths($delta)
    {
        $interval = new DateInterval('P'.abs($delta).'M');

        if ($delta > 0) {
            $this->add($interval);
        } elseif ($delta < 0) {
            $this->sub($interval);
        }

        return $this;
    }
public function addMonths ( $ delta ) { $ interval = new DateInterval ( 'P' . abs ( $ delta ) . 'M' ) ; if ( $ delta > 0 ) { $ this -> add ( $ interval ) ; } elseif ( $ delta < 0 ) { $ this -> sub ( $ interval ) ; } return $ this ; }
Go x months before or ahead.

@param int $delta The number of months to add or subtract

@return static
Go x months before or ahead .