title: PHP DateTime::modify adding and subtracting months
body: <p>I've been working a lot with the <a href="http://www.php.net/manual/en/class.datetime.php" rel="noreferrer"><code>DateTime class</code></a> and recently ran into what I thought was a bug when adding months.  After a bit of research, it appears that it wasn't a bug, but instead working as intended.  According to the documentation found <a href="http://www.php.net/manual/en/datetime.modify.php" rel="noreferrer">here</a>:</p>
  
  <blockquote>
    <p>Example #2 Beware when adding or
    subtracting months</p>
  </blockquote>
  
  <pre><code>&lt;?php
  $date = new DateTime('2000-12-31');
  
  $date-&gt;modify('+1 month');
  echo $date-&gt;format('Y-m-d') . "\n";
  
  $date-&gt;modify('+1 month');
  echo $date-&gt;format('Y-m-d') . "\n";
  ?&gt;
  </code></pre>
  
  <blockquote>
  <pre><code>The above example will output:
  2001-01-31
  2001-03-03
  </code></pre>
  </blockquote>
  
  <p>Can anyone justify why this isn't considered a bug?</p>
  
  <p>Furthermore does anyone have any elegant solutions to correct the issue and make it so +1 month will work as expected instead of as intended?</p>